From 8f488365c9a4f14bf96eab089d6ac869b675c1b4 Mon Sep 17 00:00:00 2001 From: sneakypete81 Date: Thu, 31 Oct 2013 19:43:12 +0000 Subject: [PATCH] Add system.version functional test --- tests/functional/test_system.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/functional/test_system.py diff --git a/tests/functional/test_system.py b/tests/functional/test_system.py new file mode 100644 index 0000000..6b7b26c --- /dev/null +++ b/tests/functional/test_system.py @@ -0,0 +1,31 @@ +import logging +import unittest + +import trovebox +from tests.functional import test_base + +class TestSystem(test_base.TestBase): + testcase_name = "system" + + def setUp(self): + """ + Override the default setUp, since we don't need a populated database + """ + logging.info("\nRunning %s...", self.id()) + + def test_system_version(self): + """ + Check that the API version string is returned correctly + """ + client = trovebox.Trovebox(config_file=self.config_file) + version = client.system.version() + self.assertEqual(version["api"], "v%s" % trovebox.LATEST_API_VERSION) + + @unittest.skip("Diagnostics don't work with the hosted site") + def test_system_diagnostics(self): + """ + Check that the system diagnostics can be performed + """ + client = trovebox.Trovebox(config_file=self.config_file) + diagnostics = client.system.diagnostics() + self.assertIn(diagnostics, "database")