def test_chromosomes(self): # Setup data_mngr = DataManager(self.db_path, self.mfa_path) data_mngr.select_chromosomes_from_database = MagicMock( return_value=[("dummy_01", 150, None, 10, 5, float("inf"), 0, 'dummy')]) data_mngr.select_transcription_regions_from_database = MagicMock( return_value=[(25, 80, 'dummy_01')]) data_mngr.probability_landscape = MagicMock( return_value="dummy_landscape") # Call chrm = data_mngr.chromosomes("dummy") # Assertions data_mngr.select_chromosomes_from_database.assert_called_once_with( organism="dummy") data_mngr.select_transcription_regions_from_database.assert_called_once_with( chromosome_code="dummy_01") self.assertEqual(chrm, [{ 'code': 'dummy_01', 'length': 150, 'probability_landscape': 'dummy_landscape', 'transcription_regions': [{ 'start': 25, 'end': 80 }], 'constitutive_origins': [] }])
def test_select_chromosomes_from_database(self): data_mngr = DataManager(self.db_path, self.mfa_path) data = data_mngr.select_chromosomes_from_database(organism="dummy") # Comparison based on the known data inside db self.assertEqual( data, [('dummy_01', 150, None, 10, 5, float("inf"), 0, 'dummy')])