Exemplo n.º 1
0
  def test_visit_features_node_feature_ignored(self, embl_feature_mock):
    converter = EMBLConverter(None)

    feature_node = self.mock_feature_node(1, 'ignored_type', 1, 100, '', {'attr_k1': 'attr_v1'})
    embl_feature_mock.return_value.format.return_value = None
    converter.visit_feature_node(feature_node)
    self.assertEqual(converter.contigs, {})
Exemplo n.º 2
0
  def test_visit_features_node_feature_included(self, embl_feature_mock):
    converter = EMBLConverter(None)

    feature_node = self.mock_feature_node(1, 'type_1', 1, 100, '', {'attr_k1': 'attr_v1'})
    embl_feature_mock.return_value.format.return_value = 'Feature_string'
    converter.visit_feature_node(feature_node)
    self.assertEqual(converter.contigs.keys(), [1])
    self.assertIsInstance(converter.contigs[1], EMBLContig)
Exemplo n.º 3
0
    def test_visit_features_node_feature_ignored(self, embl_feature_mock):
        converter = EMBLConverter(None)

        feature_node = self.mock_feature_node(1, 'ignored_type', 1, 100, '',
                                              {'attr_k1': 'attr_v1'})
        embl_feature_mock.return_value.format.return_value = None
        converter.visit_feature_node(feature_node)
        self.assertEqual(converter.contigs, {})
Exemplo n.º 4
0
    def test_visit_features_node_feature_included(self, embl_feature_mock):
        converter = EMBLConverter(None)

        feature_node = self.mock_feature_node(1, 'type_1', 1, 100, '',
                                              {'attr_k1': 'attr_v1'})
        embl_feature_mock.return_value.format.return_value = 'Feature_string'
        converter.visit_feature_node(feature_node)
        self.assertEqual(converter.contigs.keys(), [1])
        self.assertIsInstance(converter.contigs[1], EMBLContig)
Exemplo n.º 5
0
  def test_visit_features_node_two_different_features(self, embl_feature_mock):
    converter = EMBLConverter(None)

    feature_node = self.mock_feature_node(1, 'type_1', 1, 100, '', {'attr_k1': 'attr_v1'})
    embl_feature_mock.return_value.format.return_value = 'Feature_string'
    converter.visit_feature_node(feature_node)

    feature_node = self.mock_feature_node(2, 'type_2', 101, 200, '', {'attr_k1': 'attr_v1'})
    embl_feature_mock.return_value.format.return_value = "Another_feature_string"
    converter.visit_feature_node(feature_node)
    self.assertEqual(converter.contigs.keys(), [1, 2])
    self.assertIsInstance(converter.contigs[1], EMBLContig)
    self.assertIsInstance(converter.contigs[2], EMBLContig)
Exemplo n.º 6
0
    def test_visit_features_node_two_different_features(
            self, embl_feature_mock):
        converter = EMBLConverter(None)

        feature_node = self.mock_feature_node(1, 'type_1', 1, 100, '',
                                              {'attr_k1': 'attr_v1'})
        embl_feature_mock.return_value.format.return_value = 'Feature_string'
        converter.visit_feature_node(feature_node)

        feature_node = self.mock_feature_node(2, 'type_2', 101, 200, '',
                                              {'attr_k1': 'attr_v1'})
        embl_feature_mock.return_value.format.return_value = "Another_feature_string"
        converter.visit_feature_node(feature_node)
        self.assertEqual(converter.contigs.keys(), [1, 2])
        self.assertIsInstance(converter.contigs[1], EMBLContig)
        self.assertIsInstance(converter.contigs[2], EMBLContig)