Beispiel #1
0
    def test_get_get_port_bindings(self):
        assert_a = lambda a: self.assertEqual(get_port_bindings(a), [PortBinding('1234', None, None)])
        assert_b = lambda b: self.assertItemsEqual(get_port_bindings(b), [PortBinding('1234', None, None),
                                                                          PortBinding(1234, 1234, None),
                                                                          PortBinding(1235, 1235, '0.0.0.0')])

        assert_a('1234')
        assert_a(PortBinding('1234', None, None))
        assert_a((['1234'], ))
        assert_b(['1234', (1234, 1234), (1235, 1235, '0.0.0.0')])
        assert_b([('1234', [None, None]), PortBinding(1234, 1234, None), (1235, [1235, '0.0.0.0'])])
        assert_b({'1234': None, 1234: 1234, 1235: (1235, '0.0.0.0')})
Beispiel #2
0
    def test_get_port_bindings(self):
        assert_a = lambda a: self.assertEqual(get_port_bindings(a), [PortBinding('1234', None, None, False)])
        assert_b = lambda b: six.assertCountEqual(self, get_port_bindings(b), [PortBinding('1234', None, None, False),
                                                                               PortBinding(1234, 1234, None, False),
                                                                               PortBinding(1235, 1235, '0.0.0.0', True)])

        assert_a('1234')
        assert_a(PortBinding('1234', None, None, False))
        assert_a((['1234'], ))
        assert_b(['1234', (1234, 1234), (1235, 1235, '0.0.0.0', True)])
        assert_b([('1234', [None, None]), PortBinding(1234, 1234, None, False), (1235, [1235, '0.0.0.0', True])])
        assert_b({'1234': None, 1234: 1234, 1235: (1235, '0.0.0.0', True)})
Beispiel #3
0
    def test_get_port_bindings(self):
        assert_a = lambda a: self.assertEqual(get_port_bindings(
            a), [PortBinding('1234', None, None, False)])
        assert_b = lambda b: six.assertCountEqual(self, get_port_bindings(b), [
            PortBinding('1234', None, None, False),
            PortBinding(1234, 1234, None, False),
            PortBinding(1235, 1235, '0.0.0.0', True)
        ])

        assert_a('1234')
        assert_a(PortBinding('1234', None, None, False))
        assert_a((['1234'], ))
        assert_b(['1234', (1234, 1234), (1235, 1235, '0.0.0.0', True)])
        assert_b([('1234', [None, None]),
                  PortBinding(1234, 1234, None, False),
                  (1235, [1235, '0.0.0.0', True])])
        assert_b({'1234': None, 1234: 1234, 1235: (1235, '0.0.0.0', True)})