Skip to content

Instantly share code, notes, and snippets.

@IlianIliev
Last active February 25, 2020 20:20
Show Gist options
  • Save IlianIliev/30543d255659617e9837db86deabc904 to your computer and use it in GitHub Desktop.
Save IlianIliev/30543d255659617e9837db86deabc904 to your computer and use it in GitHub Desktop.
# AAA - Triple A is the base of testing. It stands for Arrange, Act, Assert
# Ако правилно съм разбрал правиш някакъв тул за автоматизация.
# Да кажем, че имаш някакъв сет от лампи и искаш да напишеш метод който
# проверява колко лампи са светнати в даден момент
class Lamp:
pass
def test_counter():
# Arrange
lamp_a = Lamp(on=True)
lamp_b = Lamp(on=False)
lamp_c = Lamp(on=False)
# Act
res = count_lights_on([lamp_a, lamp_b, lamp_c])
# Assert
assert res == 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment