예제 #1
0
    def test_should_parse_valid_config(self):
        # given
        config = {"hooks": {"post_switch": "/usr/bin/echo 42"}}
        self.write_config(config)

        # expect
        assert list(configs([self.tmpdir])) == [(self.tmpdir, config)]
예제 #2
0
    def test_should_parse_valid_config(self):
        # given
        config = {"hooks": {"post_switch": "/usr/bin/echo 42"}}
        self.write_config(config)

        # expect
        assert list(configs([self.tmpdir])) == [(self.tmpdir, config)]
예제 #3
0
    def test_should_pick_parse_multiple_locations(self):
        # given
        dir1 = os.path.join(self.tmpdir, "dir1")
        config1 = {"hooks": {"post_switch": "/usr/bin/echo 41"}}
        self.write_config(config1, dir1)

        dir2 = os.path.join(self.tmpdir, "dir2")
        config2 = {"hooks": {"post_switch": "/usr/bin/echo 42"}}
        self.write_config(config2, dir2)

        # expect
        assert list(configs([dir1, dir2])) == [(dir1, config1), (dir2, config2)]
예제 #4
0
 def test_should_skip_invalid_config(self):
     self.write_config_str("%")
     assert list(configs([self.tmpdir])) == []
예제 #5
0
 def test_should_skip_empty_config_dir(self):
     assert list(configs([self.tmpdir])) == []
예제 #6
0
 def test_should_skip_non_existing_config_dir(self):
     assert list(configs(["/doesnotexist"])) == []
예제 #7
0
 def test_should_skip_invalid_config(self):
     self.write_config_str("%")
     assert list(configs([self.tmpdir])) == []
예제 #8
0
 def test_should_skip_empty_config_dir(self):
     assert list(configs([self.tmpdir])) == []
예제 #9
0
 def test_should_skip_non_existing_config_dir(self):
     assert list(configs(["/doesnotexist"])) == []