Debian Codegraph @

testing/mozharness/test/test_base_python.py

raw
1 import os
2 import unittest
3
4 import mozharness.base.python as python
5 import mozunit
6
7 here = os.path.dirname(os.path.abspath(__file__))
8
9
10 class TestVirtualenvMixin(unittest.TestCase):
11 def test_package_versions(self):
12 example = os.path.join(here, "pip-freeze.example.txt")
13 output = open(example).read()
14 mixin = python.VirtualenvMixin()
15 packages = mixin.package_versions(output)
16
17 # from the file
18 expected = {
19 "MakeItSo": "0.2.6",
20 "PyYAML": "3.10",
21 "Tempita": "0.5.1",
22 "WebOb": "1.2b3",
23 "coverage": "3.5.1",
24 "logilab-astng": "0.23.1",
25 "logilab-common": "0.57.1",
26 "mozdevice": "0.2",
27 "mozhttpd": "0.3",
28 "mozinfo": "0.3.3",
29 "nose": "1.1.2",
30 "pyflakes": "0.5.0",
31 "pylint": "0.25.1",
32 "virtualenv": "1.7.1.2",
33 "wsgiref": "0.1.2",
34 }
35
36 self.assertEqual(packages, expected)
37
38
39 if __name__ == "__main__":
40 mozunit.main()