コード例 #1
0
ファイル: test_objects.py プロジェクト: Lutger/fuzzballflux
 def test_check_order(self):
     lines = self.make_tag_lines()
     headers = lines[:4]
     rest = lines[4:]
     # of all possible permutations, ensure only the original succeeds
     for perm in permutations(headers):
         perm = list(perm)
         text = '\n'.join(perm + rest)
         if perm == headers:
             self.assertCheckSucceeds(Tag, text)
         else:
             self.assertCheckFails(Tag, text)
コード例 #2
0
ファイル: test_objects.py プロジェクト: Lutger/fuzzballflux
 def test_check_order(self):
     lines = self.make_commit_lines(parents=[a_sha], encoding='UTF-8')
     headers = lines[:5]
     rest = lines[5:]
     # of all possible permutations, ensure only the original succeeds
     for perm in permutations(headers):
         perm = list(perm)
         text = '\n'.join(perm + rest)
         if perm == headers:
             self.assertCheckSucceeds(Commit, text)
         else:
             self.assertCheckFails(Commit, text)
コード例 #3
0
 def test_check_order(self):
     lines = self.make_tag_lines()
     headers = lines[:4]
     rest = lines[4:]
     # of all possible permutations, ensure only the original succeeds
     for perm in permutations(headers):
         perm = list(perm)
         text = '\n'.join(perm + rest)
         if perm == headers:
             self.assertCheckSucceeds(Tag, text)
         else:
             self.assertCheckFails(Tag, text)
コード例 #4
0
 def test_check_order(self):
     lines = self.make_commit_lines(parents=[a_sha], encoding='UTF-8')
     headers = lines[:5]
     rest = lines[5:]
     # of all possible permutations, ensure only the original succeeds
     for perm in permutations(headers):
         perm = list(perm)
         text = '\n'.join(perm + rest)
         if perm == headers:
             self.assertCheckSucceeds(Commit, text)
         else:
             self.assertCheckFails(Commit, text)
コード例 #5
0
ファイル: test_diff_tree.py プロジェクト: AaronO/dulwich
    def test_tree_entry_sort(self):
        sha = 'abcd' * 10
        expected_entries = [
          TreeChange.add(TreeEntry('aaa', F, sha)),
          TreeChange(CHANGE_COPY, TreeEntry('bbb', F, sha),
                     TreeEntry('aab', F, sha)),
          TreeChange(CHANGE_MODIFY, TreeEntry('bbb', F, sha),
                     TreeEntry('bbb', F, 'dabc' * 10)),
          TreeChange(CHANGE_RENAME, TreeEntry('bbc', F, sha),
                     TreeEntry('ddd', F, sha)),
          TreeChange.delete(TreeEntry('ccc', F, sha)),
          ]

        for perm in permutations(expected_entries):
            self.assertEqual(expected_entries,
                             sorted(perm, key=_tree_change_key))
コード例 #6
0
    def test_tree_entry_sort(self):
        sha = 'abcd' * 10
        expected_entries = [
            TreeChange.add(TreeEntry('aaa', F, sha)),
            TreeChange(CHANGE_COPY, TreeEntry('bbb', F, sha),
                       TreeEntry('aab', F, sha)),
            TreeChange(CHANGE_MODIFY, TreeEntry('bbb', F, sha),
                       TreeEntry('bbb', F, 'dabc' * 10)),
            TreeChange(CHANGE_RENAME, TreeEntry('bbc', F, sha),
                       TreeEntry('ddd', F, sha)),
            TreeChange.delete(TreeEntry('ccc', F, sha)),
        ]

        for perm in permutations(expected_entries):
            self.assertEqual(expected_entries,
                             sorted(perm, key=_tree_change_key))
コード例 #7
0
ファイル: test_walk.py プロジェクト: d-paks7/dulwich
 def test_topo_reorder_linear(self):
     commits = self.make_linear_commits(5)
     commits.reverse()
     for perm in permutations(commits):
         self.assertTopoOrderEqual(commits, perm)
コード例 #8
0
ファイル: test_walk.py プロジェクト: MadAd360/GoGramming
 def test_topo_reorder_linear(self):
     commits = self.make_linear_commits(5)
     commits.reverse()
     for perm in permutations(commits):
         self.assertTopoOrderEqual(commits, perm)