From 9428ed79435b1950c1137bb01761280a0eafda20 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 3 Oct 2013 21:52:35 +0200 Subject: [PATCH] adding nic api tests --- nsupdate/api/_tests/__init__.py | 0 nsupdate/api/_tests/test_api.py | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 nsupdate/api/_tests/__init__.py create mode 100644 nsupdate/api/_tests/test_api.py diff --git a/nsupdate/api/_tests/__init__.py b/nsupdate/api/_tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/nsupdate/api/_tests/test_api.py b/nsupdate/api/_tests/test_api.py new file mode 100644 index 0000000..86dd27c --- /dev/null +++ b/nsupdate/api/_tests/test_api.py @@ -0,0 +1,21 @@ +""" +Tests for api package. +""" + +import pytest + +# TODO XXX experiencing ImportErrors all the time. somehow project package structure is borked. +# what is the usual, working, project structure for a testable django / pytest.django project? + +pytest.skip("doesn't work due to ImportErrors....") + + +def test_myip(client): + response = client.get('/myip') + assert response.status_code == 200 + assert response.content in ['127.0.0.1', '::1'] + + +def test_nic_update(client): + response = client.get('/nic/update') + assert response.status_code == 401