From 27454aa1eee2c8ddc7d60ca86284157b239e9c00 Mon Sep 17 00:00:00 2001 From: fmonthel <fmonthel@flox-arts.net> Date: Sat, 10 Feb 2018 15:13:56 -0500 Subject: [PATCH] [ENH] Add PyTest + Travis --- .travis.yml | 3 +++ gandi-ddns.py | 2 +- test_gandi-ddns.py | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 test_gandi-ddns.py diff --git a/.travis.yml b/.travis.yml index c543946..f8d72ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,9 @@ "install": [ "pip install -r requirements.txt" ], + "script": [ + "pytest" + ], "group": "stable", "dist": "trusty", "os": "linux" diff --git a/gandi-ddns.py b/gandi-ddns.py index e71ae3b..dcf6bd3 100755 --- a/gandi-ddns.py +++ b/gandi-ddns.py @@ -95,4 +95,4 @@ def main(): update_record(url, headers, payload) if __name__ == "__main__": - main() + main() \ No newline at end of file diff --git a/test_gandi-ddns.py b/test_gandi-ddns.py new file mode 100644 index 0000000..a7d143a --- /dev/null +++ b/test_gandi-ddns.py @@ -0,0 +1,4 @@ +import gandi-ddns as script + +def test_get_ip(): + assert script.get_ip() == 'test-toto' \ No newline at end of file -- GitLab