3 # TODO: Add more tests here using all the tests/resources/* and automate those tests in a verify job
8 from changes import Changes
10 REMOTE_URL = "ssh://git.opendaylight.org:29418"
27 PROJECT_NAMES = NETVIRT_PROJECTS
28 DISTRO_PATH = "/tmp/distribution-karaf"
34 class TestChanges(unittest.TestCase):
36 print("Starting test: %s" % self.id())
40 branch, distro_patch, limit, qlimit, project_names, remote_url, loglevel=0
43 branch, distro_patch, limit, qlimit, project_names, remote_url, loglevel
45 projects = changes.run_cmd()
46 changes.pretty_print_projects(projects)
48 def test_run_cmd_single(self):
49 project_names = ["netvirt"]
52 branch, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL, logging.INFO
55 def test_run_cmd_multiple(self):
56 project_names = PROJECT_NAMES
59 branch, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL, logging.INFO
62 def test_pretty_print(self):
63 project_names = PROJECT_NAMES
64 changes = Changes(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL)
66 for project in project_names:
67 projects[project] = {"commit": 1, "includes": [{"a": 1}]}
68 changes.pretty_print_projects(projects)
69 for project in project_names:
77 "subject": "This is a test for " + project,
83 "subject": "This is a test for " + project,
87 changes.pretty_print_projects(projects)
89 def test_epoch_to_utc(self):
90 project_names = PROJECT_NAMES
91 changes = Changes(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL)
92 print("utc: %s" % changes.epoch_to_utc(1483974872))
94 def test_distcompare(self):
98 if __name__ == "__main__":