From ed8a3ebcf49967c8cf7e26d18b9ca27a71987896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=ADle=20Ekaterin=20Liszka?= Date: Fri, 12 Jan 2024 14:56:56 -0800 Subject: [PATCH] tests/test_basic.py: test fixes --- tests/test_basic.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/test_basic.py b/tests/test_basic.py index 81430f8..8744cc7 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -3,7 +3,7 @@ import pytest from xbc import loads_xbc, ParseError -class TestBare: +class TestBareLoad: def test_key(self): assert loads_xbc('a') == {'a': True} @@ -26,7 +26,7 @@ class TestBare: assert loads_xbc('a.a;a.b') == {'a.a': True, 'a.b': True} def test_string(self): - assert loads_xbc('a = "b"') == {'a': '"b"'} + assert loads_xbc('a = "b"') == {'a': 'b'} def test_array(self): assert loads_xbc('a = 1, 2') == {'a': ['1', '2']} @@ -35,9 +35,6 @@ class TestBare: with pytest.raises(ParseError): loads_xbc('a = 1\na = 2') - # currently the lexer doesn't correctly parse keyvalues with semis - # outside of blocks. no idea why. - @pytest.mark.xfail def test_reassignment_colon(self): with pytest.raises(ParseError): loads_xbc('a = 1;a = 2') @@ -46,7 +43,7 @@ class TestBare: with pytest.raises(ParseError): loads_xbc('a := 1') -class TestBlock: +class TestBlockLoad: def test_keyvalue(self): assert loads_xbc('a { a = 1 }') == {'a': False, 'a.a': '1'}