コード例 #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
ファイル: test_hosts.py プロジェクト: bsemar/IntCont
    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
ファイル: test_hosts.py プロジェクト: steverweber/salt
 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'), '')