Ejemplo n.º 1
0
 def when_mismatch_with_missing_program():
     expect(match_version("", "program not found")) == False
     expect(match_version("", "v1.2.3\nother not found")) == True
Ejemplo n.º 2
0
 def when_match_with_dash_followed_by_path():
     """Test that the output of `$ printenv DIRENV_DIR` can be matched."""
     expect(match_version("-", "-/foo/bar")) == True
Ejemplo n.º 3
0
 def when_match_with_slug_inside_path():
     """Test that the output of `$ which python` (pyenv) can be matched."""
     expect(
         match_version(
             ".pyenv",
             "Users/foobar/.pyenv/versions/2.7.14/bin/python")) == True
Ejemplo n.º 4
0
 def when_match_with_version():
     expect(match_version("1.", "v1.2.3")) == True
Ejemplo n.º 5
0
 def when_mismatch_with_version():
     expect(match_version("2.", "v1.2.3")) == False
Ejemplo n.º 6
0
 def when_match_with_name():
     expect(match_version("1.", "Foobar 1.2.3")) == True
Ejemplo n.º 7
0
 def when_mismatch_with_name():
     expect(match_version("2.", "Foobar 1.2.3")) == False
Ejemplo n.º 8
0
 def when_mismatch():
     expect(match_version("1.", "2.0")) == False
Ejemplo n.º 9
0
 def when_mismatch_at_boundary():
     expect(match_version("1.2", "1.23")) == False
Ejemplo n.º 10
0
 def when_partial_match_at_boundary():
     expect(match_version("1.2", "1.2.3")) == True
Ejemplo n.º 11
0
 def when_partial_match():
     expect(match_version("1.2.", "1.2.3")) == True
Ejemplo n.º 12
0
 def when_exact_match():
     expect(match_version("1.2.3", "1.2.3")) == True
Ejemplo n.º 13
0
 def when_mismatch_inside():
     expect(match_version("2.", "Foobar 1.2.3")) == False
Ejemplo n.º 14
0
 def when_match_inside():
     expect(match_version("1.", "Foobar 1.2.3")) == True