def test_updating_returns_updated_data(self): expected = {'updateVlanRole': {'vlanRole': {'name': 'New Name', 'slug': 'nsl1', 'weight': 1}}} result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_querying_single_returns_expected_result(self): result = schema.execute(self.query) expected = {'vlanRoles': {'edges': [ {'node': {'name': self.second.name}} ]}} self.assertEquals(result.data, expected)
def test_creating_circuit_type_returns_data(self): expected = {'newIpAddress': {'ipAddress': {'family': 'A_4', 'address': '173.16.0.0/32', 'status': 'A_3'}}} result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_querying_single_returns_expected_result(self): result = schema.execute(self.query) expected = {'circuitTypes': {'edges': [ {'node': {'name': self.first.name, 'slug': self.first.slug}} ]} } self.assertEquals(result.data, expected)
def test_querying_single_returns_expected_result(self): result = schema.execute(self.query) expected = {'sites': {'edges': [ {'node': {'name': self.first.name, 'region': {'name': self.first.region.name}}} ]}} self.assertEquals(result.data, expected)
def test_querying_single_returns_expected_result(self): result = schema.execute(self.query) expected = {'ipAddress': {'edges': [ {'node': {'address': str( netaddr.IPNetwork(self.first.address))}} ]} } self.assertEquals(result.data, expected)
def test_creating_returns_data(self): expected = {'newSite': {'site': {'name': 'New Name', 'slug': "nsl1", 'region': {'name': self.region.name}, 'tenant': {'name': self.tenant.name}}}} result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_updating_returns_updated_data(self): expected = { 'updateClusterGroup': { 'clusterGroup': { 'name': 'New Name', 'slug': 'nsl1' } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_updating_returns_updated_data(self): expected = { 'updateCircuit': { 'circuit': { 'cid': '117', 'comments': 'New Awesome Comment!' } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_updating_returns_updated_data(self): expected = { 'updateAggregate': { 'aggregate': { 'prefix': '54.0.0.0/8', 'dateAdded': '2017-01-01' } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_updating_returns_updated_data(self): expected = { 'updateProvider': { 'provider': { 'name': 'New Name', 'slug': 'psl1' } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_creating_returns_data(self): expected = { 'newTenantGroup': { 'tenantGroup': { 'name': 'Groupname', 'slug': 'groupslug' } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_creating_returns_data(self): expected = { 'newClusterType': { 'clusterType': { 'name': 'Cluster Name', 'slug': 'cl1' } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_updating_returns_updated_data(self): expected = { 'updateCluster': { 'cluster': { 'name': 'New Name', 'type': { 'name': self.type.name } } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_updating_returns_updated_data(self): expected = { 'updateRegion': { 'region': { 'slug': 'nsl1', 'parent': { 'name': self.parent.name } } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_updating_returns_updated_data(self): expected = { 'updateVirtualMachine': { 'virtualMachine': { 'name': 'New Name', 'tenant': { 'name': self.tenant.name } } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_creating_returns_data(self): expected = { 'newRir': { 'rir': { 'name': 'New Name', 'slug': 'rir', 'isPrivate': True } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_updating_returns_updated_data(self): expected = { 'updateTenant': { 'tenant': { 'name': 'New Name', 'slug': 'nsl1', 'group': { 'name': self.group.name } } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_creating_returns_data(self): expected = { 'newTenant': { 'tenant': { 'name': 'New Tenant', 'group': { 'name': self.group.name } } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_updating_returns_updated_data(self): expected = { 'updateVlanGroup': { 'vlanGroup': { 'name': 'New Name', 'slug': 'nsl1', 'site': { 'name': self.site.name } } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_creating_returns_data(self): expected = { 'newAggregate': { 'aggregate': { 'family': 'A_4', 'prefix': '192.0.0.0/12', 'rir': { 'name': self.rir.name } } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_creating_returns_data(self): expected = { 'newVlanGroup': { 'vlanGroup': { 'name': 'VLANname', 'slug': 'v1', 'site': { 'name': self.site.name } } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_querying_single_returns_expected_result(self): result = schema.execute(self.query) expected = { 'clusters': { 'edges': [{ 'node': { 'name': self.third.name, 'type': { 'name': self.third.type.name } } }] } } self.assertEquals(result.data, expected)
def test_querying_single_returns_expected_result(self): result = schema.execute(self.query) expected = { 'aggregates': { 'edges': [{ 'node': { 'family': 'A_4', 'prefix': str(self.first.prefix), 'rir': { 'name': self.first.rir.name } } }] } } self.assertEquals(result.data, expected)
def test_creating_returns_data(self): expected = { 'newVrf': { 'vrf': { 'name': 'New Name', 'rd': 'rd', 'enforceUnique': True, 'tenant': { 'name': self.tenant.name } } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_creating_provider_returns_data(self): expected = { 'newProvider': { 'provider': { 'slug': 'provider123', 'name': 'Provider123', 'asn': 256.0, 'account': 'account', 'portalUrl': 'http://github.com/', 'nocContact': 'noc', 'comments': 'my comment' } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_querying_single_provider_returns_expected_result(self): result = schema.execute(self.query) expected = { 'providers': { 'edges': [{ 'node': { 'name': self.second.name, 'slug': self.second.slug, 'asn': self.second.asn, 'account': self.second.account, 'portalUrl': self.second.portal_url, 'nocContact': self.second.noc_contact, } }] } } self.assertEquals(result.data, expected)
def test_querying_single_returns_expected_result(self): result = schema.execute(self.query) expected = { 'vrfs': { 'edges': [{ 'node': { 'name': self.first.name, 'rd': self.first.rd, 'enforceUnique': True, 'tenant': { 'name': self.first.tenant.name } } }] } } self.assertEquals(result.data, expected)
def test_creating_returns_data(self): expected = { 'newVlan': { 'vlan': { 'name': 'New Vlan', 'vid': 2, 'tenant': { 'name': self.tenant.name }, 'role': { 'name': self.role.name } } } } result = schema.execute(self.query) self.assertEquals(result.data, expected)
def test_querying_single_provider_returns_expected_result(self): result = schema.execute(self.query) expected = { 'circuits': { 'edges': [{ 'node': { 'cid': self.second.cid, 'provider': { 'name': self.second.provider.name }, 'type': { 'name': self.second.type.name }, } }] } } self.assertEquals(result.data, expected)