Example #1
0
    def test_fingerprint_interactions_titfortat(self):
        af = AshlockFingerprint(axl.TitForTat())
        af.fingerprint(turns=5, repetitions=3, step=0.5, progress_bar=False)

        # Tit-for-Tats will always cooperate if left to their own devices,
        # so interactions are invariant for any points where y is zero,
        # and the score should be maximum possible.
        # Player 1 is Point(0.0, 0.0).
        # Player 4 is Point(0.5, 0.0).
        # Player 7 is Point(1.0, 0.0).
        for iplayer in (1, 4, 7):
            for turns in af.interactions[(0, iplayer)]:
                self.assertEqual(len(turns), 5)
                self.assertTrue(all(t == (C, C) for t in turns))
        self.assertEqual(af.data[Point(0.0, 0.0)], 3.0)
        self.assertEqual(af.data[Point(0.5, 0.0)], 3.0)
        self.assertEqual(af.data[Point(1.0, 0.0)], 3.0)

        # Player 3 is Point(0.0, 1.0) which implies defection after the
        # first turn since Tit-for-Tat is playing, and a score of 0.8
        # since we get zero on first turn and one point per turn later.
        for turns in af.interactions[(0, 3)]:
            self.assertEqual(len(turns), 5)
            self.assertTrue(all(t == (D, D) for t in turns[1:]))
        self.assertAlmostEqual(af.data[Point(0.0, 1.0)], 0.8)
Example #2
0
 def test_construct_tournament_elemets(self):
     af = AshlockFingerprint(self.strategy, self.probe)
     edges, tournament_players = af.construct_tournament_elements(
         0.5, progress_bar=False)
     self.assertEqual(edges, self.expected_edges)
     self.assertEqual(len(tournament_players), 10)
     self.assertEqual(tournament_players[0].__class__, af.strategy)
Example #3
0
    def test_fingerprint_interactions_titfortat(self):
        af = AshlockFingerprint(axl.TitForTat())
        af.fingerprint(turns=5, repetitions=3, step=0.5, progress_bar=False)

        # Tit-for-Tats will always cooperate if left to their own devices,
        # so interactions are invariant for any points where y is zero,
        # and the score should be maximum possible.
        # Player 1 is Point(0.0, 0.0).
        # Player 4 is Point(0.5, 0.0).
        # Player 7 is Point(1.0, 0.0).
        for iplayer in (1, 4, 7):
            for turns in af.interactions[(0, iplayer)]:
                self.assertEqual(len(turns), 5)
                self.assertTrue(all(t == (C, C) for t in turns))
        self.assertEqual(af.data[Point(0.0, 0.0)], 3.0)
        self.assertEqual(af.data[Point(0.5, 0.0)], 3.0)
        self.assertEqual(af.data[Point(1.0, 0.0)], 3.0)

        # Player 3 is Point(0.0, 1.0) which implies defection after the
        # first turn since Tit-for-Tat is playing, and a score of 0.8
        # since we get zero on first turn and one point per turn later.
        for turns in af.interactions[(0, 3)]:
            self.assertEqual(len(turns), 5)
            self.assertTrue(all(t == (D, D) for t in turns[1:]))
        self.assertAlmostEqual(af.data[Point(0.0, 1.0)], 0.8)
Example #4
0
 def test_progress_bar_fingerprint(self):
     af = AshlockFingerprint(self.strategy, self.probe)
     data = af.fingerprint(turns=10,
                           repetitions=2,
                           step=0.5,
                           progress_bar=True)
     self.assertEqual(sorted(data.keys()), self.expected_points)
Example #5
0
    def test_fingerprint_interactions_cooperator(self):
        af = AshlockFingerprint(axl.Cooperator())
        af.fingerprint(turns=5, repetitions=3, step=0.5, progress_bar=False)

        # The keys are edges between players, values are repetitions.
        self.assertCountEqual(af.interactions.keys(), [(0, 1), (0, 2), (0, 3),
                                                       (0, 4), (0, 5), (0, 6),
                                                       (0, 7), (0, 8), (0, 9)])
        self.assertEqual(len(af.interactions.values()), 9)

        # Each edge has 3 repetitions with 5 turns each.
        repetitions = af.interactions.values()
        self.assertTrue(all(len(rep) == 3 for rep in repetitions))
        for iturn in range(3):
            self.assertTrue(all(len(rep[iturn]) == 5 for rep in repetitions))

        # Interactions are invariant for any points where y is zero, and
        # the score should be maximum possible.
        # Player 1 is Point(0.0, 0.0).
        # Player 4 is Point(0.5, 0.0).
        # Player 7 is Point(1.0, 0.0).
        for iplayer in (1, 4, 7):
            for turns in af.interactions[(0, iplayer)]:
                self.assertEqual(len(turns), 5)
                self.assertTrue(all(t == (C, C) for t in turns))
        self.assertEqual(af.data[Point(0.0, 0.0)], 3.0)
        self.assertEqual(af.data[Point(0.5, 0.0)], 3.0)
        self.assertEqual(af.data[Point(1.0, 0.0)], 3.0)

        # Player 3 is Point(0.0, 1.0), which means constant defection
        # from the probe. But the Cooperator doesn't change and score is zero.
        for turns in af.interactions[(0, 3)]:
            self.assertEqual(len(turns), 5)
            self.assertTrue(all(t == (C, D) for t in turns))
        self.assertEqual(af.data[Point(0.0, 1.0)], 0.0)
Example #6
0
 def test_progress_bar_fingerprint(self):
     af = AshlockFingerprint(axl.TitForTat)
     data = af.fingerprint(turns=10,
                           repetitions=2,
                           step=0.5,
                           progress_bar=True)
     self.assertEqual(sorted(data.keys()), self.points_when_using_half_step)
Example #7
0
    def test_plot_data(self):
        axl.seed(0)  # Fingerprinting is a random process.
        af = AshlockFingerprint(axl.Cooperator())
        af.fingerprint(turns=5, repetitions=3, step=0.5, progress_bar=False)

        reshaped_data = np.array([[0.0, 0.0, 0.0], [2.0, 1.0, 2.0], [3.0, 3.0, 3.0]])
        plotted_data = af.plot().gca().images[0].get_array()
        np.testing.assert_allclose(plotted_data, reshaped_data)
Example #8
0
 def test_serial_fingerprint(self):
     af = AshlockFingerprint(axl.TitForTat)
     data = af.fingerprint(turns=10, repetitions=2, step=0.5, progress_bar=False)
     edge_keys = sorted(list(af.interactions.keys()))
     coord_keys = sorted(list(data.keys()))
     self.assertEqual(af.step, 0.5)
     self.assertEqual(edge_keys, self.edges_when_using_half_step)
     self.assertEqual(coord_keys, self.points_when_using_half_step)
Example #9
0
    def test_plot_data(self):
        axl.seed(0)  # Fingerprinting is a random process.
        af = AshlockFingerprint(axl.Cooperator())
        af.fingerprint(turns=5, repetitions=3, step=0.5, progress_bar=False)

        reshaped_data = np.array([[0.0, 0.0, 0.0], [2.0, 1.0, 2.0], [3.0, 3.0, 3.0]])
        plotted_data = af.plot().gca().images[0].get_array()
        np.testing.assert_allclose(plotted_data, reshaped_data)
Example #10
0
 def test_serial_fingerprint(self):
     af = AshlockFingerprint(axl.TitForTat)
     data = af.fingerprint(turns=10, repetitions=2, step=0.5, progress_bar=False)
     edge_keys = sorted(list(af.interactions.keys()))
     coord_keys = sorted(list(data.keys()))
     self.assertEqual(af.step, 0.5)
     self.assertEqual(edge_keys, self.edges_when_using_half_step)
     self.assertEqual(coord_keys, self.points_when_using_half_step)
Example #11
0
 def test_fingerprint_with_filename(self):
     filename = "test_outputs/test_fingerprint.csv"
     af = AshlockFingerprint(axl.TitForTat)
     af.fingerprint(
         turns=1, repetitions=1, step=0.5, progress_bar=False, filename=filename
     )
     with open(filename, "r") as out:
         data = out.read()
         self.assertEqual(len(data.split("\n")), 20)
Example #12
0
 def test_fingerprint_with_filename(self):
     path = pathlib.Path("test_outputs/test_fingerprint.csv")
     filename = axl_filename(path)
     af = AshlockFingerprint(axl.TitForTat)
     af.fingerprint(
         turns=1, repetitions=1, step=0.5, progress_bar=False, filename=filename
     )
     with open(filename, "r") as out:
         data = out.read()
         self.assertEqual(len(data.split("\n")), 20)
Example #13
0
 def test_serial_fingerprint(self):
     af = AshlockFingerprint(self.strategy, self.probe)
     data = af.fingerprint(turns=10,
                           repetitions=2,
                           step=0.5,
                           progress_bar=False)
     edge_keys = sorted(list(af.interactions.keys()))
     coord_keys = sorted(list(data.keys()))
     self.assertEqual(af.step, 0.5)
     self.assertEqual(edge_keys, self.expected_edges)
     self.assertEqual(coord_keys, self.expected_points)
Example #14
0
 def test_fingerprint_with_filename(self):
     filename = "test_outputs/test_fingerprint.csv"
     af = AshlockFingerprint(self.strategy, self.probe)
     af.fingerprint(turns=1,
                    repetitions=1,
                    step=0.5,
                    progress_bar=False,
                    filename=filename)
     with open(filename, 'r') as out:
         data = out.read()
         self.assertEqual(len(data.split("\n")), 10)
Example #15
0
    def test_fingeprint_explicit_probe(self):
        af = AshlockFingerprint(axl.TitForTat(), probe=axl.Random(p=0.1))
        af.fingerprint(turns=10, repetitions=2, step=0.5, progress_bar=False)

        probes = af.spatial_tournament.players[1:]
        self.assertEqual(str(probes[0]),
                         "Joss-Ann Random: 0.1: (0.0, 0.0)")  # x + y < 1
        self.assertEqual(str(probes[2]),
                         "Dual Joss-Ann Random: 0.1: (1.0, 0.0)")  # x + y = 1
        self.assertEqual(str(probes[8]),
                         "Dual Joss-Ann Random: 0.1: (0.0, 0.0)")  # x + y > 1
Example #16
0
 def test_in_memory_fingerprint(self):
     af = AshlockFingerprint(self.strategy, self.probe)
     af.fingerprint(turns=10,
                    repetitions=2,
                    step=0.5,
                    progress_bar=False,
                    in_memory=True)
     edge_keys = sorted(list(af.interactions.keys()))
     coord_keys = sorted(list(af.data.keys()))
     self.assertEqual(af.step, 0.5)
     self.assertEqual(af.spatial_tournament.interactions_dict,
                      af.interactions)
     self.assertEqual(edge_keys, self.expected_edges)
     self.assertEqual(coord_keys, self.expected_points)
Example #17
0
    def test_fingeprint_explicit_probe(self):
        af = AshlockFingerprint(axl.TitForTat(), probe=axl.Random(p=0.1))
        af.fingerprint(turns=10, repetitions=2, step=0.5, progress_bar=False)

        probes = af.spatial_tournament.players[1:]
        self.assertEqual(
            str(probes[0]), "Joss-Ann Random: 0.1: (0.0, 0.0)"
        )  # x + y < 1
        self.assertEqual(
            str(probes[2]), "Dual Joss-Ann Random: 0.1: (1.0, 0.0)"
        )  # x + y = 1
        self.assertEqual(
            str(probes[8]), "Dual Joss-Ann Random: 0.1: (0.0, 0.0)"
        )  # x + y > 1
Example #18
0
    def test_init_with_instance(self):
        player = self.strategy()
        fingerprint = AshlockFingerprint(player)
        self.assertEqual(fingerprint.strategy, player)
        self.assertEqual(fingerprint.probe, self.probe)

        probe_player = self.probe()
        fingerprint = AshlockFingerprint(self.strategy, probe_player)
        self.assertEqual(fingerprint.strategy, self.strategy)
        self.assertEqual(fingerprint.probe, probe_player)

        fingerprint = AshlockFingerprint(player, probe_player)
        self.assertEqual(fingerprint.strategy, player)
        self.assertEqual(fingerprint.probe, probe_player)
Example #19
0
    def test_init_with_instances(self):
        player = axl.WinStayLoseShift()
        fingerprint = AshlockFingerprint(player)
        self.assertEqual(fingerprint.strategy, player)
        self.assertEqual(fingerprint.probe, axl.TitForTat)

        probe = axl.Random()
        fingerprint = AshlockFingerprint(axl.WinStayLoseShift, probe)
        self.assertEqual(fingerprint.strategy, axl.WinStayLoseShift)
        self.assertEqual(fingerprint.probe, probe)

        fingerprint = AshlockFingerprint(player, probe)
        self.assertEqual(fingerprint.strategy, player)
        self.assertEqual(fingerprint.probe, probe)
Example #20
0
 def test_plot(self):
     af = AshlockFingerprint(self.strategy, self.probe)
     af.fingerprint(turns=10, repetitions=2, step=0.25, progress_bar=False)
     p = af.plot()
     self.assertIsInstance(p, matplotlib.pyplot.Figure)
     q = af.plot(col_map='jet')
     self.assertIsInstance(q, matplotlib.pyplot.Figure)
     r = af.plot(interpolation='bicubic')
     self.assertIsInstance(r, matplotlib.pyplot.Figure)
     t = af.plot(title='Title')
     self.assertIsInstance(t, matplotlib.pyplot.Figure)
     u = af.plot(colorbar=False)
     self.assertIsInstance(u, matplotlib.pyplot.Figure)
     v = af.plot(labels=False)
     self.assertIsInstance(v, matplotlib.pyplot.Figure)
Example #21
0
 def test_plot_figure(self):
     af = AshlockFingerprint(axl.WinStayLoseShift, axl.TitForTat)
     af.fingerprint(turns=10, repetitions=2, step=0.25, progress_bar=False)
     p = af.plot()
     self.assertIsInstance(p, matplotlib.pyplot.Figure)
     q = af.plot(cmap="jet")
     self.assertIsInstance(q, matplotlib.pyplot.Figure)
     r = af.plot(interpolation="bicubic")
     self.assertIsInstance(r, matplotlib.pyplot.Figure)
     t = af.plot(title="Title")
     self.assertIsInstance(t, matplotlib.pyplot.Figure)
     u = af.plot(colorbar=False)
     self.assertIsInstance(u, matplotlib.pyplot.Figure)
     v = af.plot(labels=False)
     self.assertIsInstance(v, matplotlib.pyplot.Figure)
Example #22
0
    def test_temp_file_creation(self):

        RecordedMksTemp.reset_record()
        af = AshlockFingerprint(axl.TitForTat)
        filename = "test_outputs/test_fingerprint.csv"

        self.assertEqual(RecordedMksTemp.record, [])

        # Temp file is created and destroyed.
        af.fingerprint(
            turns=1, repetitions=1, step=0.5, progress_bar=False, filename=None
        )

        self.assertEqual(len(RecordedMksTemp.record), 1)
        filename = RecordedMksTemp.record[0][1]
        self.assertIsInstance(filename, str)
        self.assertNotEqual(filename, "")
        self.assertFalse(os.path.isfile(filename))
Example #23
0
 def test_plot_figure(self):
     af = AshlockFingerprint(axl.WinStayLoseShift, axl.TitForTat)
     af.fingerprint(turns=10, repetitions=2, step=0.25, progress_bar=False)
     p = af.plot()
     self.assertIsInstance(p, matplotlib.pyplot.Figure)
     q = af.plot(cmap="jet")
     self.assertIsInstance(q, matplotlib.pyplot.Figure)
     r = af.plot(interpolation="bicubic")
     self.assertIsInstance(r, matplotlib.pyplot.Figure)
     t = af.plot(title="Title")
     self.assertIsInstance(t, matplotlib.pyplot.Figure)
     u = af.plot(colorbar=False)
     self.assertIsInstance(u, matplotlib.pyplot.Figure)
     v = af.plot(labels=False)
     self.assertIsInstance(v, matplotlib.pyplot.Figure)
Example #24
0
    def test_temp_file_creation(self):

        RecordedMksTemp.reset_record()
        af = AshlockFingerprint(axl.TitForTat)
        path = pathlib.Path("test_outputs/test_fingerprint.csv")
        filename = axl_filename(path)

        self.assertEqual(RecordedMksTemp.record, [])

        # Temp file is created and destroyed.
        af.fingerprint(
            turns=1, repetitions=1, step=0.5, progress_bar=False, filename=None
        )

        self.assertEqual(len(RecordedMksTemp.record), 1)
        filename = RecordedMksTemp.record[0][1]
        self.assertIsInstance(filename, str)
        self.assertNotEqual(filename, "")
        self.assertFalse(os.path.isfile(filename))
Example #25
0
    def test_temp_file_creation(self):

        RecordedMksTemp.reset_record()
        af = AshlockFingerprint(self.strategy, self.probe)
        filename = "test_outputs/test_fingerprint.csv"

        self.assertEqual(RecordedMksTemp.record, [])

        # Temp file is created and destroyed.
        af.fingerprint(turns=1,
                       repetitions=1,
                       step=0.5,
                       progress_bar=False,
                       filename=None)

        self.assertEqual(len(RecordedMksTemp.record), 1)
        filename = RecordedMksTemp.record[0][1]
        self.assertIsInstance(filename, str)
        self.assertNotEqual(filename, '')
        self.assertFalse(os.path.isfile(filename))
Example #26
0
    def test_fingerprint_player(self):
        af = AshlockFingerprint(axl.Cooperator())
        af.fingerprint(turns=5, repetitions=3, step=0.5, progress_bar=False)

        self.assertEqual(af.step, 0.5)
        self.assertEqual(af.points, self.points_when_using_half_step)
        self.assertEqual(af.spatial_tournament.turns, 5)
        self.assertEqual(af.spatial_tournament.repetitions, 3)
        self.assertEqual(af.spatial_tournament.edges,
                         self.edges_when_using_half_step)

        # The first player is the fingerprinted one, the rest are probes.
        self.assertIsInstance(af.spatial_tournament.players[0], axl.Cooperator)
        self.assertEqual(len(af.spatial_tournament.players), 10)
        probes = af.spatial_tournament.players[1:]
        self.assertEqual(len(probes), len(af.points))
        self.assertEqual(str(probes[0]),
                         "Joss-Ann Tit For Tat: (0.0, 0.0)")  # x + y < 1
        self.assertEqual(str(probes[2]),
                         "Dual Joss-Ann Tit For Tat: (1.0, 0.0)")  # x + y = 1
        self.assertEqual(str(probes[8]),
                         "Dual Joss-Ann Tit For Tat: (0.0, 0.0)")  # x + y > 1
Example #27
0
    def test_fingerprint_interactions_cooperator(self):
        af = AshlockFingerprint(axl.Cooperator())
        af.fingerprint(turns=5, repetitions=3, step=0.5, progress_bar=False)

        # The keys are edges between players, values are repetitions.
        self.assertCountEqual(
            af.interactions.keys(),
            [(0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (0, 7), (0, 8), (0, 9)],
        )
        self.assertEqual(len(af.interactions.values()), 9)

        # Each edge has 3 repetitions with 5 turns each.
        repetitions = af.interactions.values()
        self.assertTrue(all(len(rep) == 3 for rep in repetitions))
        for iturn in range(3):
            self.assertTrue(all(len(rep[iturn]) == 5 for rep in repetitions))

        # Interactions are invariant for any points where y is zero, and
        # the score should be maximum possible.
        # Player 1 is Point(0.0, 0.0).
        # Player 4 is Point(0.5, 0.0).
        # Player 7 is Point(1.0, 0.0).
        for iplayer in (1, 4, 7):
            for turns in af.interactions[(0, iplayer)]:
                self.assertEqual(len(turns), 5)
                self.assertTrue(all(t == (C, C) for t in turns))
        self.assertEqual(af.data[Point(0.0, 0.0)], 3.0)
        self.assertEqual(af.data[Point(0.5, 0.0)], 3.0)
        self.assertEqual(af.data[Point(1.0, 0.0)], 3.0)

        # Player 3 is Point(0.0, 1.0), which means constant defection
        # from the probe. But the Cooperator doesn't change and score is zero.
        for turns in af.interactions[(0, 3)]:
            self.assertEqual(len(turns), 5)
            self.assertTrue(all(t == (C, D) for t in turns))
        self.assertEqual(af.data[Point(0.0, 1.0)], 0.0)
Example #28
0
    def test_fingerprint_player(self):
        af = AshlockFingerprint(axl.Cooperator())
        af.fingerprint(turns=5, repetitions=3, step=0.5, progress_bar=False)

        self.assertEqual(af.step, 0.5)
        self.assertEqual(af.points, self.points_when_using_half_step)
        self.assertEqual(af.spatial_tournament.turns, 5)
        self.assertEqual(af.spatial_tournament.repetitions, 3)
        self.assertEqual(af.spatial_tournament.edges, self.edges_when_using_half_step)

        # The first player is the fingerprinted one, the rest are probes.
        self.assertIsInstance(af.spatial_tournament.players[0], axl.Cooperator)
        self.assertEqual(len(af.spatial_tournament.players), 10)
        probes = af.spatial_tournament.players[1:]
        self.assertEqual(len(probes), len(af.points))
        self.assertEqual(
            str(probes[0]), "Joss-Ann Tit For Tat: (0.0, 0.0)"
        )  # x + y < 1
        self.assertEqual(
            str(probes[2]), "Dual Joss-Ann Tit For Tat: (1.0, 0.0)"
        )  # x + y = 1
        self.assertEqual(
            str(probes[8]), "Dual Joss-Ann Tit For Tat: (0.0, 0.0)"
        )  # x + y > 1
Example #29
0
    def test_pair_fingerprints(self, strategy_pair):
        """
        A test to check that we can fingerprint
        with any two given strategies or instances
        """
        strategy, probe = strategy_pair
        af = AshlockFingerprint(strategy, probe)
        data = af.fingerprint(turns=2, repetitions=2, step=0.5, progress_bar=False)
        self.assertIsInstance(data, dict)

        af = AshlockFingerprint(strategy(), probe)
        data = af.fingerprint(turns=2, repetitions=2, step=0.5, progress_bar=False)
        self.assertIsInstance(data, dict)

        af = AshlockFingerprint(strategy, probe())
        data = af.fingerprint(turns=2, repetitions=2, step=0.5, progress_bar=False)
        self.assertIsInstance(data, dict)

        af = AshlockFingerprint(strategy(), probe())
        data = af.fingerprint(turns=2, repetitions=2, step=0.5, progress_bar=False)
        self.assertIsInstance(data, dict)
Example #30
0
    def test_fingerprint_reproducibility(self, strategy_pair):
        """
        A test to check that we can fingerprint
        with any two given strategies or instances
        """
        strategy, probe = strategy_pair
        af = AshlockFingerprint(strategy(), probe())
        data = af.fingerprint(turns=2,
                              repetitions=2,
                              step=0.5,
                              progress_bar=False,
                              seed=4)

        strategy, probe = strategy_pair
        af = AshlockFingerprint(strategy(), probe())
        data2 = af.fingerprint(turns=2,
                               repetitions=2,
                               step=0.5,
                               progress_bar=False,
                               seed=4)

        self.assertEqual(data, data2)
Example #31
0
 def test_init(self):
     fingerprint = AshlockFingerprint(self.strategy, self.probe)
     self.assertEqual(fingerprint.strategy, self.strategy)
     self.assertEqual(fingerprint.probe, self.probe)
Example #32
0
 def test_progress_bar_fingerprint(self):
     af = AshlockFingerprint(axl.TitForTat)
     data = af.fingerprint(turns=10, repetitions=2, step=0.5, progress_bar=True)
     self.assertEqual(sorted(data.keys()), self.points_when_using_half_step)
Example #33
0
 def test_default_init(self):
     fingerprint = AshlockFingerprint(axl.WinStayLoseShift)
     self.assertEqual(fingerprint.strategy, axl.WinStayLoseShift)
     self.assertEqual(fingerprint.probe, axl.TitForTat)
Example #34
0
 def test_init_with_explicit_probe(self):
     fingerprint = AshlockFingerprint(axl.WinStayLoseShift, axl.Random)
     self.assertEqual(fingerprint.strategy, axl.WinStayLoseShift)
     self.assertEqual(fingerprint.probe, axl.Random)
Example #35
0
    def test_pair_fingerprints(self, strategy_pair):
        """
        A test to check that we can fingerprint
        with any two given strategies or instances
        """
        strategy, probe = strategy_pair
        af = AshlockFingerprint(strategy, probe)
        data = af.fingerprint(turns=2,
                              repetitions=2,
                              step=0.5,
                              progress_bar=False)
        self.assertIsInstance(data, dict)

        af = AshlockFingerprint(strategy(), probe)
        data = af.fingerprint(turns=2,
                              repetitions=2,
                              step=0.5,
                              progress_bar=False)
        self.assertIsInstance(data, dict)

        af = AshlockFingerprint(strategy, probe())
        data = af.fingerprint(turns=2,
                              repetitions=2,
                              step=0.5,
                              progress_bar=False)
        self.assertIsInstance(data, dict)

        af = AshlockFingerprint(strategy(), probe())
        data = af.fingerprint(turns=2,
                              repetitions=2,
                              step=0.5,
                              progress_bar=False)
        self.assertIsInstance(data, dict)