示例#1
0
 def test_load(self):
     assert OSS_Participant('test-user.md').load().exists()
     assert OSS_Participant('Test User').load().exists()
     assert OSS_Participant('aaaa/../test-user.md').load().exists()
     assert OSS_Participant('content/participant/Test User').load().exists()
     assert OSS_Participant(
         'content/participant/test-user.md').load().exists()
 def load_oss_participants(self, paths):
     results = {}
     for path in paths:
         participant = OSS_Participant(name=path)
         if participant.exists():
             results[participant.name] = participant
     return results
 def md_files_participants(self):
     return self.md_files_in_folder(OSS_Participant().base_folder)
 def setUp(self):
     self.test_name    = 'Test User'
     self.participant  = OSS_Participant(self.test_name)
     self.result       = None
     self.participant.create()
     self.participant.load()
 def test_exists(self):
     assert self.participant          .exists() is True
     assert OSS_Participant('OSS Bot').exists() is True
     assert OSS_Participant('OSS bot').exists() is True
     assert OSS_Participant('oss bot').exists() is True
     assert OSS_Participant('oss-bot').exists() is True
     assert OSS_Participant('oss_bot').exists() is False
     assert OSS_Participant('oss_bbb').exists() is False
     assert OSS_Participant('Dinis Cruz' ).exists() is True
     assert OSS_Participant('dinis cruz' ).exists() is True
     assert OSS_Participant('Dinis-Cruz' ).exists() is True
     assert OSS_Participant('Dinis Cruz ').exists() is True
     assert OSS_Participant('Dinis_Cruz' ).exists() is False
     assert OSS_Participant('Dinis Cruz_').exists() is False
示例#6
0
    def participant_get(self, user_name):
        import sys
        sys.path.append('/tmp/oss2019/notebooks/api')
        from oss_hugo.OSS_Participant import OSS_Participant  # shows error on PyCharm

        return OSS_Participant(name=user_name, folder_oss=self.repo_path)