@@ -13,69 +13,69 @@ def tearDown(self):
13
13
def test_valid_input (self ):
14
14
with patch ('builtins.input' , side_effect = ['1' , '5' ]):
15
15
with self .assertRaises (SystemExit ) as cm :
16
- import scripts . igfi
16
+ import igfi
17
17
self .assertEqual (cm .exception .code , 0 )
18
18
19
19
def test_invalid_python_version (self ):
20
20
with patch ('sys.version_info' , (2 , 7 , 10 , 'final' , 0 )):
21
21
with patch ('builtins.input' , side_effect = ['1' , '5' ]):
22
22
with self .assertRaises (SystemExit ) as cm :
23
- import scripts . igfi
23
+ import igfi
24
24
self .assertEqual (cm .exception .code , 0 )
25
25
26
26
def test_missing_required_packages (self ):
27
27
with patch ('sys.modules' , {'rich' : None }):
28
28
with patch ('builtins.input' , side_effect = ['1' , '5' ]):
29
29
with self .assertRaises (SystemExit ) as cm :
30
- import scripts . igfi
30
+ import igfi
31
31
self .assertEqual (cm .exception .code , 0 )
32
32
33
33
def test_root_user_linux (self ):
34
34
with patch ('sys.platform' , 'linux' ):
35
35
with patch ('os.geteuid' , return_value = 0 ):
36
36
with patch ('builtins.input' , side_effect = ['1' , '5' ]):
37
37
with self .assertRaises (SystemExit ) as cm :
38
- import scripts . igfi
38
+ import igfi
39
39
self .assertEqual (cm .exception .code , 0 )
40
40
41
41
def test_invalid_username_input (self ):
42
42
with patch ('builtins.input' , side_effect = ['1' , 'ausernamenoonewouldeveruse321' , '5' ]):
43
43
with self .assertRaises (SystemExit ) as cm :
44
- import scripts . igfi
44
+ import igfi
45
45
self .assertEqual (cm .exception .code , 0 )
46
46
47
47
def test_uninstall_option (self ):
48
48
with patch ('builtins.input' , side_effect = ['4' ]):
49
49
with self .assertRaises (SystemExit ) as cm :
50
- import scripts . igfi
50
+ import igfi
51
51
self .assertEqual (cm .exception .code , 0 )
52
52
53
53
def test_info_display (self ):
54
54
with patch ('builtins.input' , side_effect = ['2' , '5' ]):
55
55
with self .assertRaises (SystemExit ) as cm :
56
- import scripts . igfi
56
+ import igfi
57
57
self .assertEqual (cm .exception .code , 0 )
58
58
59
59
def test_clear_log (self ):
60
60
with patch ('os.path.exists' , return_value = True ):
61
61
with patch ('os.remove' ):
62
62
with patch ('builtins.input' , side_effect = ['3' , '5' ]):
63
63
with self .assertRaises (SystemExit ) as cm :
64
- import scripts . igfi
64
+ import igfi
65
65
self .assertEqual (cm .exception .code , 0 )
66
66
67
67
def test_session_file_not_found (self ):
68
68
with patch ('os.path.exists' , return_value = False ):
69
69
with patch ('builtins.input' , side_effect = ['1' , '5' ]):
70
70
with self .assertRaises (SystemExit ) as cm :
71
- import scripts . igfi
71
+ import igfi
72
72
self .assertEqual (cm .exception .code , 0 )
73
73
74
74
def test_valid_operation (self ):
75
75
with patch ('builtins.input' , side_effect = ['1' , 'yes' , 'yes' , '5' ]):
76
76
with self .assertRaises (SystemExit ) as cm :
77
- import scripts . igfi
77
+ import igfi
78
78
self .assertEqual (cm .exception .code , 0 )
79
79
80
80
if __name__ == '__main__' :
81
- unittest .main ()
81
+ unittest .main ()
0 commit comments