First pass at tool to list gerrits included in a karaf distribution
[integration/test.git] / tools / distchanges / tests / test_changes.py
1 #!/usr/bin/env python
2
3 import unittest
4
5 from changes import Changes
6
7 REMOTE_URL = 'ssh://git.opendaylight.org:29418'
8 PROJECT_NAMES = ['genius', 'mdsal', 'netvirt', 'neutron', 'openflowjava', 'openflowplugin', 'ovsdb', 'yangtools']
9 DISTRO_PATH = "/tmp/distribution-karaf"
10 BRANCH = 'master'
11 LIMIT = 10
12 QLIMIT = 50
13
14
15 class TestChanges(unittest.TestCase):
16
17     def setUp(self):
18         print("Starting test: %s" % self.id())
19
20     @staticmethod
21     def run_cmd(branch, distro_patch, limit, qlimit, project_names, remote_url):
22         changes = Changes(branch, distro_patch, limit, qlimit, project_names, remote_url)
23         projects = changes.run_cmd()
24         changes.pretty_print_projects(projects)
25
26     def test_run_cmd_single(self):
27         project_names = ['openflowplugin']
28         self.run_cmd(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL)
29
30     def test_run_cmd_multiple(self):
31         project_names = PROJECT_NAMES
32         self.run_cmd(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL)
33
34
35 if __name__ == '__main__':
36     unittest.main()