def given_client( self, url=None, username=None, password=None, timeout=None): return network_topology.NetworkTopologyClient( url=url or self.given_url_with_port, username=username or self.given_username, password=password or self.given_password, timeout=timeout or self.given_timeout)
def test_constructor(self): # When client is created rest_client = network_topology.NetworkTopologyClient( url=self.given_url_with_port, username=self.given_username, password=self.given_password, timeout=self.given_timeout) self.assertEqual( self.given_url_with_port + 'restconf/operational/network-topology:network-topology', rest_client.url) self.assertEqual((self.given_username, self.given_password), rest_client.session.auth) self.assertEqual(self.given_timeout, rest_client.timeout)