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"
26 PROJECT_NAMES = NETVIRT_PROJECTS
27 DISTRO_PATH = "/tmp/distribution-karaf"
33 class TestChanges(unittest.TestCase):
35 print("Starting test: %s" % self.id())
39 branch, distro_patch, limit, qlimit, project_names, remote_url, loglevel=0
42 branch, distro_patch, limit, qlimit, project_names, remote_url, loglevel
44 projects = changes.run_cmd()
45 changes.pretty_print_projects(projects)
47 def test_run_cmd_single(self):
48 project_names = ["netvirt"]
51 branch, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL, logging.INFO
54 def test_run_cmd_multiple(self):
55 project_names = PROJECT_NAMES
58 branch, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL, logging.INFO
61 def test_pretty_print(self):
62 project_names = PROJECT_NAMES
63 changes = Changes(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL)
65 for project in project_names:
66 projects[project] = {"commit": 1, "includes": [{"a": 1}]}
67 changes.pretty_print_projects(projects)
68 for project in project_names:
76 "subject": "This is a test for " + project,
82 "subject": "This is a test for " + project,
86 changes.pretty_print_projects(projects)
88 def test_epoch_to_utc(self):
89 project_names = PROJECT_NAMES
90 changes = Changes(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL)
91 print("utc: %s" % changes.epoch_to_utc(1483974872))
93 def test_distcompare(self):
97 if __name__ == "__main__":