Ejemplo n.º 1
0
 def test_create_cache(self):
     with TempDirectory() as temp:
         directory = create_ziphmm_directory(temp.path)
         xdir = ZipDirectory(directory)
         self.assertFalse(xdir.is_cached(3))
         xdir.create_cache(3)
         self.assertTrue(xdir.is_cached(3))
Ejemplo n.º 2
0
 def test_init_without_data(self):
     with TempDirectory() as temp:
         directory = create_ziphmm_directory(temp.path)
         data_structure_path = os.path.join(directory, 'data_structure')
         os.remove(data_structure_path)
         xdir = ZipDirectory(directory)
         self.assertEqual(directory, xdir.path)
Ejemplo n.º 3
0
 def test_init_without_data(self):
     with TempDirectory() as temp:
         directory = create_ziphmm_directory(temp.path)
         data_structure_path = os.path.join(directory, 'data_structure')
         os.remove(data_structure_path)
         xdir = ZipDirectory(directory)
         self.assertEqual(directory, xdir.path)
Ejemplo n.º 4
0
 def test_create_cache(self):
     with TempDirectory() as temp:
         directory = create_ziphmm_directory(temp.path)
         xdir = ZipDirectory(directory)
         self.assertFalse(xdir.is_cached(3))
         xdir.create_cache(3)
         self.assertTrue(xdir.is_cached(3))
Ejemplo n.º 5
0
 def test_clear_cache(self):
     with TempDirectory() as temp:
         directory = create_ziphmm_directory(temp.path)
         xdir = ZipDirectory(directory)
         self.assertTrue(os.path.isfile(
             os.path.join(directory, 'data_structure')))
         xdir.clear_cache()
         self.assertFalse(os.path.isfile(
             os.path.join(directory, 'data_structure')))
Ejemplo n.º 6
0
 def test_clear_cache(self):
     with TempDirectory() as temp:
         directory = create_ziphmm_directory(temp.path)
         xdir = ZipDirectory(directory)
         self.assertTrue(
             os.path.isfile(os.path.join(directory, 'data_structure')))
         xdir.clear_cache()
         self.assertFalse(
             os.path.isfile(os.path.join(directory, 'data_structure')))
Ejemplo n.º 7
0
    def test_load(self):
        with TempDirectory() as temp:
            directory = create_ziphmm_directory(temp.path)
            xdir = ZipDirectory(directory)

            self.assertTrue(xdir.is_cached(2))
            xseq2 = xdir.load(2)
            self.assertEqual(2, xseq2.state_count)
            self.assertTrue(xdir.is_cached(2))

            self.assertFalse(xdir.is_cached(3))
            xseq3 = xdir.load(3)
            self.assertEqual(3, xseq3.state_count)
            self.assertTrue(xdir.is_cached(3))

            self.assertFalse(xdir.is_cached(4))
            xseq4 = xdir.load(4)
            self.assertEqual(4, xseq4.state_count)
            self.assertTrue(xdir.is_cached(4))
Ejemplo n.º 8
0
    def test_load(self):
        with TempDirectory() as temp:
            directory = create_ziphmm_directory(temp.path)
            xdir = ZipDirectory(directory)

            self.assertTrue(xdir.is_cached(2))
            xseq2 = xdir.load(2)
            self.assertEqual(2, xseq2.state_count)
            self.assertTrue(xdir.is_cached(2))

            self.assertFalse(xdir.is_cached(3))
            xseq3 = xdir.load(3)
            self.assertEqual(3, xseq3.state_count)
            self.assertTrue(xdir.is_cached(3))

            self.assertFalse(xdir.is_cached(4))
            xseq4 = xdir.load(4)
            self.assertEqual(4, xseq4.state_count)
            self.assertTrue(xdir.is_cached(4))
Ejemplo n.º 9
0
 def test_init_with_data(self):
     with TempDirectory() as temp:
         directory = create_ziphmm_directory(temp.path)
         xdir = ZipDirectory(directory)
         self.assertEqual(directory, xdir.path)
Ejemplo n.º 10
0
 def test_has_original_sequence(self):
     with TempDirectory() as temp:
         self.assertFalse(ZipDirectory.has_original_sequence(temp.path))
         directory = create_ziphmm_directory(temp.path)
         self.assertTrue(ZipDirectory.has_original_sequence(directory))
Ejemplo n.º 11
0
 def test_init_with_data(self):
     with TempDirectory() as temp:
         directory = create_ziphmm_directory(temp.path)
         xdir = ZipDirectory(directory)
         self.assertEqual(directory, xdir.path)
Ejemplo n.º 12
0
 def test_has_original_sequence(self):
     with TempDirectory() as temp:
         self.assertFalse(ZipDirectory.has_original_sequence(temp.path))
         directory = create_ziphmm_directory(temp.path)
         self.assertTrue(ZipDirectory.has_original_sequence(directory))