'Assert that the provided spec is able to be parsed.
If this is called with one argument, it assumes that the
string is canonical (i.e., no spaces and ~ instead of - for
variants) and that it will convert back to the string it came
from.
If this is called with two arguments, the first argument is
the expected canonical form and the second is a non-canonical
input to be parsed.'

def check_parse(self, expected, spec=None, remove_arch=True):

    if (spec is None):
        spec = expected
    output = sp.parse(spec)
    parsed = '    '.join((str(spec) for spec in output))
    assert (expected == parsed)
