def test_two_nodes_linking_to_self(self):
        # given
        graph_builder = builder.Graph().with_kmer_size(3)

        # when
        expect = KmerGraphExpectation(
            ContigRetriever(graph_builder.build()).get_kmer_graph('TTAA'))

        # then
        expect.has_edge('TTA', 'TAA', 1)
        expect.has_n_edges(1)
    def test_with_two_linked_kmers_returns_two_kmers(self):
        # given
        graph_builder = (builder.Graph().with_kmer_size(3))
        graph_builder.with_kmer('AAA', 1, '.....C..')
        graph_builder.with_kmer('AAC', 1, 'a.......')
        retriever = ContigRetriever(graph_builder.build())

        # when
        expect = KmerGraphExpectation(retriever.get_kmer_graph('AAA'))

        # then
        expect.has_nodes('AAA', 'AAC').has_n_edges(1)
        expect.has_edge('AAA', 'AAC', 0)
    def test_two_node_path_and_three_node_cycle(self):
        # given
        colors = [0, 1]
        graph_builder = (builder.Graph().with_kmer_size(3).with_kmer(
            'AAA', 1, '.....C..').with_kmer('AAC', 1, 'a.....G.').with_kmer(
                'ACG', 1, 'a.g.A...').with_kmer('CGA', 1,
                                                'a....C..').with_kmer(
                                                    'GAC', 1, '.c....G.'))

        retriever = ContigRetriever(graph_builder.build())

        # when
        expect = KmerGraphExpectation(retriever.get_kmer_graph('AAACGAC'))

        # then
        for color in colors:
            expect.has_edge('AAA', 'AAC', color)
            expect.has_edge('AAC', 'ACG', color)
            expect.has_edge('ACG', 'CGA', color)
            expect.has_edge('CGA', 'GAC', color)
        expect.has_edge('GAC', 'ACG', 0)
        expect.has_n_edges(9)