Beispiel #1
0
def test_parse_braces_fail():
	for expression in ['{', '}', '{}', '{5', '{1}', 'A{-7}', 'A{', 'A{1', 'N{7', 'AN{7', 'A{4{}',
			'A{4}{3}', 'A{b}', 'A{6X}', 'A{X6}']:
		print(expression)
		try:
			Adapter.parse_braces(expression)
		except ValueError as e:
			print(e)
		assert_raises(ValueError, lambda: Adapter.parse_braces(expression))
Beispiel #2
0
def test_parse_braces_fail():
    for expression in [
            '{', '}', '{}', '{5', '{1}', 'A{-7}', 'A{', 'A{1', 'N{7', 'AN{7',
            'A{4{}', 'A{4}{3}', 'A{b}', 'A{6X}', 'A{X6}'
    ]:
        print(expression)
        try:
            Adapter.parse_braces(expression)
        except ValueError as e:
            print(e)
        assert_raises(ValueError, lambda: Adapter.parse_braces(expression))
Beispiel #3
0
def test_parse_braces():
	assert Adapter.parse_braces('') == ''
	assert Adapter.parse_braces('A') == 'A'
	assert Adapter.parse_braces('A{0}') == ''
	assert Adapter.parse_braces('A{1}') == 'A'
	assert Adapter.parse_braces('A{2}') == 'AA'
	assert Adapter.parse_braces('A{2}C') == 'AAC'
	assert Adapter.parse_braces('ACGTN{3}TGACCC') == 'ACGTNNNTGACCC'
	assert Adapter.parse_braces('ACGTN{10}TGACCC') == 'ACGTNNNNNNNNNNTGACCC'
	assert Adapter.parse_braces('ACGTN{3}TGA{4}CCC') == 'ACGTNNNTGAAAACCC'
	assert Adapter.parse_braces('ACGTN{0}TGA{4}CCC') == 'ACGTTGAAAACCC'
Beispiel #4
0
def test_parse_braces():
    assert Adapter.parse_braces('') == ''
    assert Adapter.parse_braces('A') == 'A'
    assert Adapter.parse_braces('A{0}') == ''
    assert Adapter.parse_braces('A{1}') == 'A'
    assert Adapter.parse_braces('A{2}') == 'AA'
    assert Adapter.parse_braces('A{2}C') == 'AAC'
    assert Adapter.parse_braces('ACGTN{3}TGACCC') == 'ACGTNNNTGACCC'
    assert Adapter.parse_braces('ACGTN{10}TGACCC') == 'ACGTNNNNNNNNNNTGACCC'
    assert Adapter.parse_braces('ACGTN{3}TGA{4}CCC') == 'ACGTNNNTGAAAACCC'
    assert Adapter.parse_braces('ACGTN{0}TGA{4}CCC') == 'ACGTTGAAAACCC'