5 from changes import Changes
7 REMOTE_URL = 'ssh://git.opendaylight.org:29418'
8 NETVIRT_PROJECTS = ["netvirt", "controller", "dlux", "dluxapps", "genius", "infrautils", "mdsal", "netconf",
9 "neutron", "odlparent", "openflowplugin", "ovsdb", "sfc", "yangtools"]
10 PROJECT_NAMES = NETVIRT_PROJECTS
11 DISTRO_PATH = "/tmp/distribution-karaf"
17 class TestChanges(unittest.TestCase):
20 print("Starting test: %s" % self.id())
23 def run_cmd(branch, distro_patch, limit, qlimit, project_names, remote_url):
24 changes = Changes(branch, distro_patch, limit, qlimit, project_names, remote_url, 0)
25 projects = changes.run_cmd()
26 changes.pretty_print_projects(projects)
28 def test_run_cmd_single(self):
29 project_names = ['netvirt']
30 self.run_cmd(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL)
32 def test_run_cmd_multiple(self):
33 project_names = PROJECT_NAMES
34 self.run_cmd(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL)
36 def test_pretty_print(self):
37 project_names = PROJECT_NAMES
38 changes = Changes(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL)
40 for project in project_names:
41 projects[project] = {"commit": 1, "includes": [{'a': 1}]}
42 changes.pretty_print_projects(projects)
43 for project in project_names:
44 projects[project] = {"commit": 1,
45 "includes": [{"grantedOn": 1, "lastUpdated": 11,
46 "number": "12345", "subject": "This is a test for " + project},
47 {"grantedOn": 2, "lastUpdated": 22,
48 "number": "56789", "subject": "This is a test for " + project}]}
49 changes.pretty_print_projects(projects)
51 def test_epoch_to_utc(self):
52 project_names = PROJECT_NAMES
53 changes = Changes(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL)
54 print("utc: %s" % changes.epoch_to_utc(1483974872))
56 def test_distcompare(self):
60 if __name__ == '__main__':