def test_record_deleted_when_delete_events_occur(self): s3(delete_event, None) self.assertFalse( self.table.get_item(Key={ 'package_name': 'z', 'version': '0' }).get('Item'))
def test_record_created_for_various_package_suffices(self): self.assertFalse( self.table.get_item(Key={ 'package_name': 'a-0.zip', 'version': '0' }).get('Item')) s3(put_event(package_name='a-0.zip'), None) item = self.table.get_item(Key={ 'package_name': 'a-0.zip', 'version': '0' }).get('Item') self.assertEqual( { 'normalized_name': 'a', 'version': '0', 'package_name': 'a-0.zip', 'filename': 'a-0.zip' }, item) self.assertFalse( self.table.get_item(Key={ 'package_name': 'a-0.tar.bz3', 'version': '0' }).get('Item')) s3(put_event(package_name='a-0.tar.bz3'), None) item = self.table.get_item(Key={ 'package_name': 'a-0.tar.bz3', 'version': '0' }).get('Item') self.assertEqual( { 'normalized_name': 'a', 'version': '0', 'package_name': 'a-0.tar.bz3', 'filename': 'a-0.tar.bz3' }, item)
def test_record_created_when_put_events_occur(self): self.assertFalse( self.table.get_item(Key={ 'package_name': 'a', 'version': '0' }).get('Item')) s3(put_event, None) item = self.table.get_item(Key={ 'package_name': 'a', 'version': '0' }).get('Item') self.assertEqual( { 'normalized_name': 'a', 'version': '0', 'package_name': 'a', 'filename': 'a-0.tar.gz' }, item)
def test_record_created_with_url_quoted_file_names(self): self.assertFalse( self.table.get_item(Key={ 'package_name': 'a b-0.tar.gz', 'version': '0' }).get('Item')) s3(put_event(), None) item = self.table.get_item(Key={ 'package_name': 'a b-0.tar.gz', 'version': '0' }).get('Item') self.assertEqual( { 'normalized_name': 'a b', 'version': '0', 'package_name': 'a b-0.tar.gz', 'filename': 'a b-0.tar.gz' }, item)
def test_record_created_when_put_wheel_events_occur(self): self.assertFalse( self.table.get_item( Key={ 'package_name': 'z-0-cp34-cp34m-manylinux1_x86_64.whl', 'version': '0' }).get('Item')) s3(put_event_for_wheel, None) item = self.table.get_item(Key={ 'package_name': 'z-0-cp34-cp34m-manylinux1_x86_64.whl', 'version': '0' }).get('Item') self.assertEqual( { 'normalized_name': 'z', 'version': '0', 'package_name': 'z-0-cp34-cp34m-manylinux1_x86_64.whl', 'filename': 'z-0-cp34-cp34m-manylinux1_x86_64.whl' }, item)