コード例 #1
0
ファイル: params_test.py プロジェクト: saliormoon/rally
    def test_sequential_conflicts(self):
        self.assertEqual([
            "         0",
            "         1",
            "         2",
            "         3",
            "         4",
            "         5",
            "         6",
            "         7",
            "         8",
            "         9",
            "        10",
        ],
                         params.build_conflicting_ids(
                             params.IndexIdConflict.SequentialConflicts, 11,
                             0))

        self.assertEqual([
            "         5",
            "         6",
            "         7",
            "         8",
            "         9",
            "        10",
            "        11",
            "        12",
            "        13",
            "        14",
            "        15",
        ],
                         params.build_conflicting_ids(
                             params.IndexIdConflict.SequentialConflicts, 11,
                             5))
コード例 #2
0
    def test_sequential_conflicts(self):
        self.assertEqual(
            [
                "         0",
                "         1",
                "         2",
                "         3",
                "         4",
                "         5",
                "         6",
                "         7",
                "         8",
                "         9",
                "        10",
            ],
            params.build_conflicting_ids(params.IndexIdConflict.SequentialConflicts, 11, 0)
        )

        self.assertEqual(
            [
                "         5",
                "         6",
                "         7",
                "         8",
                "         9",
                "        10",
                "        11",
                "        12",
                "        13",
                "        14",
                "        15",
            ],
            params.build_conflicting_ids(params.IndexIdConflict.SequentialConflicts, 11, 5)
        )
コード例 #3
0
ファイル: params_test.py プロジェクト: saliormoon/rally
 def test_build_conflicting_ids(self):
     self.assertIsNone(
         params.build_conflicting_ids(params.IndexIdConflict.NoConflicts, 3,
                                      0))
     self.assertEqual(["         0", "         1", "         2"],
                      params.build_conflicting_ids(
                          params.IndexIdConflict.SequentialConflicts, 3, 0))
     # we cannot tell anything specific about the contents...
     self.assertEqual(
         3,
         len(
             params.build_conflicting_ids(
                 params.IndexIdConflict.RandomConflicts, 3, 0)))
コード例 #4
0
ファイル: params_test.py プロジェクト: saliormoon/rally
    def test_random_conflicts(self):
        self.assertEqual(["         3", "         3", "         3"],
                         params.build_conflicting_ids(
                             params.IndexIdConflict.RandomConflicts,
                             3,
                             0,
                             rand=lambda x, y: y))

        self.assertEqual(["         8", "         8", "         8"],
                         params.build_conflicting_ids(
                             params.IndexIdConflict.RandomConflicts,
                             3,
                             5,
                             rand=lambda x, y: y))
コード例 #5
0
    def test_random_conflicts(self):
        self.assertEqual(
            [
                "         3",
                "         3",
                "         3"
            ],
            params.build_conflicting_ids(params.IndexIdConflict.RandomConflicts, 3, 0, rand=lambda x, y: y)
        )

        self.assertEqual(
            [
                "         8",
                "         8",
                "         8"
            ],
            params.build_conflicting_ids(params.IndexIdConflict.RandomConflicts, 3, 5, rand=lambda x, y: y)
        )
コード例 #6
0
ファイル: params_test.py プロジェクト: saliormoon/rally
 def test_no_id_conflicts(self):
     self.assertIsNone(params.build_conflicting_ids(None, 100, 0))
     self.assertIsNone(
         params.build_conflicting_ids(params.IndexIdConflict.NoConflicts,
                                      100, 0))
コード例 #7
0
 def test_no_id_conflicts(self):
     self.assertIsNone(params.build_conflicting_ids(None, 100, 0))
     self.assertIsNone(params.build_conflicting_ids(params.IndexIdConflict.NoConflicts, 100, 0))
コード例 #8
0
 def test_build_conflicting_ids(self):
     self.assertIsNone(params.build_conflicting_ids(params.IndexIdConflict.NoConflicts, 3, 0))
     self.assertEqual(["         0", "         1", "         2"],
                      params.build_conflicting_ids(params.IndexIdConflict.SequentialConflicts, 3, 0))
     # we cannot tell anything specific about the contents...
     self.assertEqual(3, len(params.build_conflicting_ids(params.IndexIdConflict.RandomConflicts, 3, 0)))