Completed
Pull Request — develop (#141)
by Jace
02:42
created

describe_launch()   A

Complexity

Conditions 4

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 4
c 3
b 0
f 0
dl 0
loc 12
rs 9.2
1
# pylint: disable=unused-variable,expression-not-assigned
2
3
from unittest.mock import patch, call, Mock
4
5
from expecter import expect
6
7
from gitman import system
8
9
10
def describe_launch():
11
12
    @patch('platform.system', Mock(return_value="Windows"))
13
    @patch('gitman.system._launch_windows')
14
    def it_opens_files(startfile):
15
        system.launch("fake/path")
16
        expect(startfile.mock_calls) == [call("fake/path")]
17
18
    @patch('platform.system', Mock(return_value="fake"))
19
    def it_raises_an_exception_when_platform_is_unknown():
20
        with expect.raises(RuntimeError):
21
            system.launch(None)
22