예제 #1
0
파일: hosts_test.py 프로젝트: DaveQB/salt
    def test_get_ip(self):
        '''
        Tests return ip associated with the named host
        '''
        self.assertEqual('10.10.10.10', hosts.get_ip('Salt1'))

        self.assertEqual('', hosts.get_ip('Salt3'))
예제 #2
0
    def test_get_ip(self):
        '''
        Tests return ip associated with the named host
        '''
        self.assertEqual('10.10.10.10', hosts.get_ip('Salt1'))

        self.assertEqual('', hosts.get_ip('Salt3'))
예제 #3
0
파일: hosts_test.py 프로젝트: bryson/salt
    def test_get_ip(self):
        """
        Tests return ip associated with the named host
        """
        self.assertEqual("10.10.10.10", hosts.get_ip("Salt1"))

        self.assertEqual("", hosts.get_ip("Salt3"))
예제 #4
0
    def test_get_ip(self):
        '''
        Tests return ip associated with the named host
        '''
        with patch('salt.modules.hosts._list_hosts',
                   MagicMock(return_value={'10.10.10.10': ['Salt1', 'Salt2']})):
            self.assertEqual('10.10.10.10', hosts.get_ip('Salt1'))

            self.assertEqual('', hosts.get_ip('Salt3'))
예제 #5
0
    def test_get_ip(self):
        """
        Tests return ip associated with the named host
        """
        with patch(
                "salt.modules.hosts._list_hosts",
                MagicMock(return_value={"10.10.10.10": ["Salt1", "Salt2"]}),
        ):
            self.assertEqual("10.10.10.10", hosts.get_ip("Salt1"))

            self.assertEqual("", hosts.get_ip("Salt3"))
예제 #6
0
 def test_get_ip_none(self):
     """
     Tests return ip associated with the named host
     """
     with patch("salt.modules.hosts._list_hosts",
                MagicMock(return_value="")):
         self.assertEqual("", hosts.get_ip("Salt1"))
예제 #7
0
 def test_get_ip_none(self):
     '''
     Tests return ip associated with the named host
     '''
     with patch('salt.modules.hosts._list_hosts',
                MagicMock(return_value='')):
         self.assertEqual('', hosts.get_ip('Salt1'))
예제 #8
0
 def test_get_ip(self):
     list_hosts.hosts_filename = self.hostspath
     self.assertEqual(get_ip('myname'), '127.0.0.1')
     self.assertEqual(get_ip('othername'), '')
     list_hosts.hosts_filename = self.not_found
     self.assertEqual(get_ip('othername'), '')
예제 #9
0
파일: hosts.py 프로젝트: JustinCarmony/salt
 def test_get_ip(self):
     list_hosts.hosts_filename = self.hostspath
     self.assertEqual(get_ip('myname'), '127.0.0.1')
     self.assertEqual(get_ip('othername'), '')
     list_hosts.hosts_filename = self.not_found
     self.assertEqual(get_ip('othername'), '')