@@ -33,6 +33,7 @@ def test_simple(self):
33
33
)
34
34
r .close ()
35
35
self .assertTrue (1 , parser .component_count ())
36
+ self .assertFalse (parser .has_warnings ())
36
37
37
38
def test_example_1 (self ):
38
39
with open (os .path .join (os .path .dirname (__file__ ), 'fixtures/requirements-example-1.txt' )) as r :
@@ -41,6 +42,7 @@ def test_example_1(self):
41
42
)
42
43
r .close ()
43
44
self .assertTrue (3 , parser .component_count ())
45
+ self .assertFalse (parser .has_warnings ())
44
46
45
47
def test_example_with_comments (self ):
46
48
with open (os .path .join (os .path .dirname (__file__ ), 'fixtures/requirements-with-comments.txt' )) as r :
@@ -49,6 +51,7 @@ def test_example_with_comments(self):
49
51
)
50
52
r .close ()
51
53
self .assertTrue (5 , parser .component_count ())
54
+ self .assertFalse (parser .has_warnings ())
52
55
53
56
def test_example_multiline_with_comments (self ):
54
57
with open (os .path .join (os .path .dirname (__file__ ), 'fixtures/requirements-multilines-with-comments.txt' )) as r :
@@ -57,6 +60,7 @@ def test_example_multiline_with_comments(self):
57
60
)
58
61
r .close ()
59
62
self .assertTrue (5 , parser .component_count ())
63
+ self .assertFalse (parser .has_warnings ())
60
64
61
65
@unittest .skip ('Not yet supported' )
62
66
def test_example_with_hashes (self ):
@@ -66,3 +70,14 @@ def test_example_with_hashes(self):
66
70
)
67
71
r .close ()
68
72
self .assertTrue (5 , parser .component_count ())
73
+ self .assertFalse (parser .has_warnings ())
74
+
75
+ def test_example_without_pinned_versions (self ):
76
+ with open (os .path .join (os .path .dirname (__file__ ), 'fixtures/requirements-without-pinned-versions.txt' )) as r :
77
+ parser = RequirementsParser (
78
+ requirements_content = r .read ()
79
+ )
80
+ r .close ()
81
+ self .assertTrue (2 , parser .component_count ())
82
+ self .assertTrue (parser .has_warnings ())
83
+ self .assertEqual (3 , len (parser .get_warnings ()))
0 commit comments