Ejemplo n.º 1
0
class HostsRoleTest(ProvyTestCase):
    def setUp(self):
        super(HostsRoleTest, self).setUp()
        self.role = HostsRole(prov=None, context={})

    @istest
    def ensures_a_host_line_exists_in_the_hosts_file(self):
        with self.mock_role_method('ensure_line') as ensure_line:
            self.role.ensure_host('my-server', '0.0.0.0')

            ensure_line.assert_called_once_with('0.0.0.0        my-server', '/etc/hosts', sudo=True)
Ejemplo n.º 2
0
class HostsRoleTest(ProvyTestCase):
    def setUp(self):
        super(HostsRoleTest, self).setUp()
        self.role = HostsRole(prov=None, context={})

    @istest
    def ensures_a_host_line_exists_in_the_hosts_file(self):
        with self.mock_role_method('ensure_line') as ensure_line:
            self.role.ensure_host('my-server', '0.0.0.0')

            ensure_line.assert_called_once_with('0.0.0.0        my-server',
                                                '/etc/hosts',
                                                sudo=True)
Ejemplo n.º 3
0
 def setUp(self):
     super(HostsRoleTest, self).setUp()
     self.role = HostsRole(prov=None, context={})
Ejemplo n.º 4
0
 def setUp(self):
     super(HostsRoleTest, self).setUp()
     self.role = HostsRole(prov=None, context={})