Example #1
0
 def test_skips_empty_emails(self):
     doc = {
         'name': 'foo',
         'maintainers': [{
             'email': ''
         }, {
             'email': '     '
         }]
     }
     assert sync_npm.process_doc(doc)['emails'] == []
Example #2
0
 def test_dedupes_emails(self):
     doc = {
         'name': 'foo',
         'maintainers': [{
             'email': 'alice'
         }, {
             'email': 'alice'
         }]
     }
     assert sync_npm.process_doc(doc)['emails'] == ['alice']
Example #3
0
 def test_returns_None_if_no_name(self):
     assert sync_npm.process_doc({}) is None
Example #4
0
 def test_backfills_missing_keys(self):
     actual = sync_npm.process_doc({'name': 'foo'})
     assert actual == {'name': 'foo', 'description': '', 'emails': []}
Example #5
0
 def test_extracts_maintainer_emails(self):
     doc = {'name': 'foo', 'maintainers': [{'email': '*****@*****.**'}]}
     assert sync_npm.process_doc(doc)['emails'] == ['*****@*****.**']
 def test_dedupes_emails(self):
     doc = {'name': 'foo', 'maintainers': [{'email': 'alice'}, {'email': 'alice'}]}
     assert sync_npm.process_doc(doc)['emails'] == ['alice']
 def test_skips_empty_emails(self):
     doc = {'name': 'foo', 'maintainers': [{'email': ''}, {'email': '     '}]}
     assert sync_npm.process_doc(doc)['emails'] == []
 def test_extracts_maintainer_emails(self):
     doc = {'name': 'foo', 'maintainers': [{'email': '*****@*****.**'}]}
     assert sync_npm.process_doc(doc)['emails'] == ['*****@*****.**']
 def test_backfills_missing_keys(self):
     actual = sync_npm.process_doc({'name': 'foo'})
     assert actual == {'name': 'foo', 'description': '', 'emails': []}
 def test_returns_None_if_no_name(self):
     assert sync_npm.process_doc({}) is None