Make sure new sources show up in the source/list output

Also remove an unneeded makedirs from test_server.py
This commit is contained in:
Brian C. Lane 2018-05-30 09:48:37 -07:00
parent 25bae61520
commit f1000b448d
1 changed files with 14 additions and 0 deletions

View File

@ -498,6 +498,13 @@ class ServerTestCase(unittest.TestCase):
data = json.loads(resp.data)
self.assertEqual(data, {"status":True})
# Is it listed?
resp = self.server.get("/api/v0/projects/source/list")
data = json.loads(resp.data)
self.assertNotEqual(data, None)
sources = data["sources"]
self.assertTrue("new-repo-1" in sources)
def test_projects_source_00_new_toml(self):
"""Test /api/v0/projects/source/new with a new toml source"""
toml_source = open("./tests/pylorax/source/test-repo.toml").read()
@ -508,6 +515,13 @@ class ServerTestCase(unittest.TestCase):
data = json.loads(resp.data)
self.assertEqual(data, {"status":True})
# Is it listed?
resp = self.server.get("/api/v0/projects/source/list")
data = json.loads(resp.data)
self.assertNotEqual(data, None)
sources = data["sources"]
self.assertTrue("new-repo-2" in sources)
def test_projects_source_00_replace(self):
"""Test /api/v0/projects/source/new with a replacement source"""
toml_source = open("./tests/pylorax/source/replace-repo.toml").read()