예제 #1
0
class TestSanity():
    """A class to test the basic features of the defaults module
    """

    defaults_file = FakeFs.File("/etc/default/ovirt")

    def setUp(self):
        FakeFs.erase()
        self.defaults_file.touch()
        logging.basicConfig()

    def test_chaining(self):
        cfg = DummyNodeConfigFileSection()

        cfg.update("bar").commit("secret")

        assert cfg.txe_counter == 1
        assert self.defaults_file.read() == 'DUMMY_KEY="bar"\n'
        assert cfg.secret == "secret"

        cfg.configure_dummy().commit("baz")

        assert cfg.txe_counter == 2
        assert cfg.secret == "baz"
        assert self.defaults_file.read() == 'DUMMY_KEY="default"\n'
예제 #2
0
 def setUp(self):
     FakeFs.erase()
     FakeFs.File("/etc/default/ovirt").touch()
예제 #3
0
 def setUp(self):
     FakeFs.erase()
     FakeFs.File("/etc/default/ovirt").touch()
     FakeFs.File("/etc/system-release-cpe")\
         .write("cpe:/o:fedoraproject:fedora:19")