Пример #1
0
 def test_it_is_cached(self, commit_file, tag_file, build_time_file):
     with self.clear_version_info():
         version_info = views.get_version_info()
         commit_file.remove()
         tag_file.remove()
         build_time_file.remove()
         assert version_info == views.get_version_info()
Пример #2
0
 def test_it_is_cached(self, commit_file, tag_file):
     commit, tag = views.get_version_info()
     assert commit == 'bc685e4be05a182ae819990509c92affa3d882ab'
     assert tag == 'v20'
     commit_file.remove()
     tag_file.remove()
     assert (commit, tag) == views.get_version_info()
Пример #3
0
 def test_with_nothing(self, version_info_dir):
     commit, tag = views.get_version_info()
     assert commit == 'unknown'
     assert tag == 'unknown'
Пример #4
0
 def test_with_only_tag(self, tag_file):
     commit, tag = views.get_version_info()
     assert commit == 'unknown'
     assert tag == 'v20'
Пример #5
0
 def test_with_only_commit(self, commit_file):
     commit, tag = views.get_version_info()
     assert commit == 'bc685e4be05a182ae819990509c92affa3d882ab'
     assert tag == 'unknown'
Пример #6
0
 def test_with_both(self, commit_file, tag_file):
     commit, tag = views.get_version_info()
     assert commit == 'bc685e4be05a182ae819990509c92affa3d882ab'
     assert tag == 'v20'
Пример #7
0
 def test_with_only_tag(self, tag_file):
     with self.clear_version_info():
         version_info = views.get_version_info()
         assert version_info['commit'] is None
         assert version_info['version'] == tag_file.tag
         assert version_info['build_time'] is None
Пример #8
0
 def test_with_only_commit(self, commit_file):
     with self.clear_version_info():
         version_info = views.get_version_info()
         assert version_info['commit'] == commit_file.commit
         assert version_info['version'] is None
         assert version_info['build_time'] is None
Пример #9
0
 def test_with_everything(self, commit_file, tag_file, build_time_file):
     with self.clear_version_info():
         version_info = views.get_version_info()
         assert version_info['commit'] == commit_file.commit
         assert version_info['version'] == tag_file.tag
         assert version_info['build_time'] == build_time_file.datetime
Пример #10
0
 def test_with_nothing(self, version_info_dir):
     with self.clear_version_info():
         version_info = views.get_version_info()
         assert version_info['commit'] is None
         assert version_info['version'] is None
         assert version_info['build_time'] is None
Пример #11
0
 def test_with_only_build_time(self, build_time_file):
     with self.clear_version_info():
         version_info = views.get_version_info()
         assert version_info['commit'] is None
         assert version_info['version'] is None
         assert version_info['build_time'] == build_time_file.datetime