def test_process_satellite_source(self): """Test process satellite source.""" fact_collection = self._create_satellite_fc_json() fact = fact_collection['facts'][0] source = { 'source_id': 1, 'source_type': Source.SATELLITE_SOURCE_TYPE, 'facts': fact_collection['facts'] } fingerprints = _process_source(fact_collection['id'], source) fingerprint = fingerprints[0] self._validate_satellite_result(fingerprint, fact)
def test_process_vcenter_source(self): """Test process vcenter source.""" fact_collection = self._create_vcenter_fc_json() fact = fact_collection['facts'][0] source = { 'source_id': 1, 'source_type': Source.VCENTER_SOURCE_TYPE, 'facts': fact_collection['facts'] } fingerprints = _process_source(fact_collection['id'], source) fingerprint = fingerprints[0] self._validate_vcenter_result(fingerprint, fact)
def test_process_network_source(self): """Test process network source.""" fact_collection = self._create_network_fc_json() fact = fact_collection['facts'][0] source = { 'source_id': 1, 'source_type': Source.NETWORK_SOURCE_TYPE, 'facts': fact_collection['facts'] } fingerprints = _process_source(fact_collection['id'], source) fingerprint = fingerprints[0] self._validate_network_result(fingerprint, fact)
def _create_satellite_fingerprint(self, *args, **kwargs): """Create test network/vcenter fingerprints.""" s_fact_collection = self._create_satellite_fc_json(*args, **kwargs) vfact = s_fact_collection['facts'][0] source = { 'source_id': 2, 'source_type': Source.SATELLITE_SOURCE_TYPE, 'facts': s_fact_collection['facts'] } sfingerprints = _process_source(s_fact_collection['id'], source) sfingerprint = sfingerprints[0] self._validate_satellite_result(sfingerprint, vfact) return sfingerprint
def _create_vcenter_fingerprint(self, *args, **kwargs): """Create test network/vcenter fingerprints.""" v_fact_collection = self._create_vcenter_fc_json(*args, **kwargs) vfact = v_fact_collection['facts'][0] source = { 'source_id': 2, 'source_type': Source.VCENTER_SOURCE_TYPE, 'facts': v_fact_collection['facts'] } vfingerprints = _process_source(v_fact_collection['id'], source) vfingerprint = vfingerprints[0] self._validate_vcenter_result(vfingerprint, vfact) return vfingerprint
def _create_network_fingerprint(self, *args, **kwargs): """Create test network fingerprint.""" n_fact_collection = self._create_network_fc_json(*args, **kwargs) nfact = n_fact_collection['facts'][0] source = { 'source_id': 1, 'source_type': Source.NETWORK_SOURCE_TYPE, 'facts': n_fact_collection['facts'] } nfingerprints = _process_source(n_fact_collection['id'], source) nfingerprint = nfingerprints[0] self._validate_network_result(nfingerprint, nfact) return nfingerprint