InspectEnvironmentPackageTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_inspect_env_package() 0 14 2
1
import unittest
2
from ..env import EnvInspector, inspect_env_package
3
4
from binstar_client.utils.test.utils import data_dir
5
6
7
class EnvInspectorTestCase(unittest.TestCase):
8
    def test_package_name(self):
9
        with open(data_dir('environment.yml')) as fileobj:
10
            assert EnvInspector('environment.yml', fileobj).name == 'stats'
11
12
    def test_version(self):
13
        with open(data_dir('environment.yml')) as fileobj:
14
            self.assertIsInstance(EnvInspector('environment.yml', fileobj).version, str)
15
16
17
class InspectEnvironmentPackageTest(unittest.TestCase):
18
    def test_inspect_env_package(self):
19
        with open(data_dir('environment.yml')) as fileobj:
20
            package_data, release_data, file_data = inspect_env_package(
21
                'environment.yml', fileobj)
22
23
        self.assertEqual({
24
            'name': 'stats',
25
            'summary': 'Environment file'
26
        }, package_data)
27
28
        self.assertEqual({
29
            'basename': 'environment.yml',
30
            'attrs': {}
31
        }, file_data)
32
33
34
if __name__ == '__main__':
35
    unittest.main()
36