@@ -51,13 +51,13 @@ def test_schema():
5151def test_get_build_packages ():
5252 plugin = PythonPlugin (part_name = "my-part" , options = lambda : None )
5353
54- plugin .get_build_packages () == {"findutils" , "python3-venv" , "python3-dev" }
54+ assert plugin .get_build_packages () == {"findutils" , "python3-venv" , "python3-dev" }
5555
5656
5757def test_get_build_environment ():
5858 plugin = PythonPlugin (part_name = "my-part" , options = lambda : None )
5959
60- plugin .get_build_environment () == {
60+ assert plugin .get_build_environment () == {
6161 "PATH" : "${SNAPCRAFT_PART_INSTALL}/bin:${PATH}" ,
6262 "SNAPCRAFT_PYTHON_INTERPRETER" : "python3" ,
6363 "SNAPCRAFT_PYTHON_VENV_ARGS" : "" ,
@@ -105,12 +105,15 @@ class Options:
105105
106106 plugin = PythonPlugin (part_name = "my-part" , options = Options ())
107107
108- plugin .get_build_commands () == [
109- '"${SNAPCRAFT_PYTHON_INTERPRETER}" -m venv ${SNAPCRAFT_PYTHON_VENV_ARGS} '
110- '"${SNAPCRAFT_PART_INSTALL}"' ,
111- '. "${SNAPCRAFT_PART_INSTALL}/bin/activate"' ,
112- "[ -f setup.py ] && pip install -U ." ,
113- ] + _FIXUP_BUILD_COMMANDS
108+ assert (
109+ plugin .get_build_commands ()
110+ == [
111+ '"${SNAPCRAFT_PYTHON_INTERPRETER}" -m venv ${SNAPCRAFT_PYTHON_VENV_ARGS} '
112+ '"${SNAPCRAFT_PART_INSTALL}"' ,
113+ "[ -f setup.py ] && pip install -U ." ,
114+ ]
115+ + _FIXUP_BUILD_COMMANDS
116+ )
114117
115118
116119def test_get_build_commands_with_all_properties ():
@@ -121,11 +124,14 @@ class Options:
121124
122125 plugin = PythonPlugin (part_name = "my-part" , options = Options ())
123126
124- plugin .get_build_commands () == [
125- '"${SNAPCRAFT_PYTHON_INTERPRETER}" -m venv ${SNAPCRAFT_PYTHON_VENV_ARGS} '
126- '"${SNAPCRAFT_PART_INSTALL}"' ,
127- '. "${SNAPCRAFT_PART_INSTALL}/bin/activate"' ,
128- "pip install -c 'constraints.txt' -U pip" ,
129- "pip install -c 'constraints.txt' -U -r 'requirements.txt'" ,
130- "[ -f setup.py ] && pip install -c 'constraints.txt' -U ." ,
131- ] + _FIXUP_BUILD_COMMANDS
127+ assert (
128+ plugin .get_build_commands ()
129+ == [
130+ '"${SNAPCRAFT_PYTHON_INTERPRETER}" -m venv ${SNAPCRAFT_PYTHON_VENV_ARGS} '
131+ '"${SNAPCRAFT_PART_INSTALL}"' ,
132+ "pip install -c 'constraints.txt' -U pip" ,
133+ "pip install -c 'constraints.txt' -U -r 'requirements.txt'" ,
134+ "[ -f setup.py ] && pip install -c 'constraints.txt' -U ." ,
135+ ]
136+ + _FIXUP_BUILD_COMMANDS
137+ )
0 commit comments