def test_normalize_NormalizedDocument(self): output = celerytasks._consume(DIRECTORY) results = output[0] registry = output[1] with open(MANIFEST) as f: manifest = yaml.load(f) for result in results: test_doc = celerytasks._normalize(result, TIMESTAMP, registry, manifest) assert isinstance(test_doc, NormalizedDocument)
def test_consume_consumer_version(self): results = celerytasks._consume(DIRECTORY) assert isinstance(results[2], str)
def test_consume_registry_hasconsumefunc(self): results = celerytasks._consume(DIRECTORY) registry = results[1] registry_dicts = registry.consumers[DIRECTORY] assert callable(registry_dicts['consume'])
def test_consume_registry_consumers_haskeys(self): results = celerytasks._consume(DIRECTORY) registry = results[1] registry_dicts = registry.consumers[DIRECTORY] assert registry_dicts.keys() == ['normalize', 'consume']
def test_consume_registry_consumers_isdict(self): results = celerytasks._consume(DIRECTORY) registry = results[1] registry_dicts = registry.consumers[DIRECTORY] assert isinstance(registry_dicts, dict)
def test_consume_Registry(self): results = celerytasks._consume(DIRECTORY) assert isinstance(results[1], _Registry)
def test_consume_RawDoc(self): result_list = celerytasks._consume(DIRECTORY) for result in result_list[0]: assert isinstance(result, RawDocument)