From f54aa527b772136b04cbb7247ce0273591f3d531 Mon Sep 17 00:00:00 2001
From: Fize Jacques <jacques.fize@cirad.fr>
Date: Wed, 6 Feb 2019 23:34:06 +0100
Subject: [PATCH] mod Travis.yml +test.py

---
 .travis.yml            |  5 ++---
 gmatch4py/test/test.py | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100644 gmatch4py/test/test.py

diff --git a/.travis.yml b/.travis.yml
index a45c6ef..6d510f8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,5 @@
 language: python
 python:
-  - "2.7"
   - "3.6"
 
 notifications:
@@ -8,7 +7,7 @@ notifications:
 
 install:
     - pip install -q cython numpy networkx scipy scikit-learn pandas
-    - python setup.py install
+    - python setup.py build_ext --inplace
 
 script:
-  - pytest gmatch4py
\ No newline at end of file
+  - pytest
\ No newline at end of file
diff --git a/gmatch4py/test/test.py b/gmatch4py/test/test.py
new file mode 100644
index 0000000..3db601c
--- /dev/null
+++ b/gmatch4py/test/test.py
@@ -0,0 +1,26 @@
+import pytest
+    
+
+def nimport():
+    # Gmatch4py use networkx graph 
+    import networkx as nx 
+    # import the GED using the munkres algorithm
+    import gmatch4py as gm
+
+def test_import():
+    nimport()
+
+def ged():
+    import networkx as nx
+    # import the GED using the munkres algorithm
+    import gmatch4py as gm
+    g1=nx.complete_bipartite_graph(5,4)
+    g2=nx.complete_bipartite_graph(6,4)
+    ged=gm.GraphEditDistance(1,1,1,1) # all edit costs are equal to 1
+    assert ged.compare([g1,g2],None).all() == ged.compare([g1,g2],None).all()
+    ged=gm.HED(1,1,1,1) # all edit costs are equal to 1
+    assert ged.compare([g1,g2],None).all() == ged.compare([g1,g2],None).all()
+
+
+def test_ged():
+    ged()
\ No newline at end of file
-- 
GitLab