Просмотр исходного кода

Fix test_guest_name_three_words_last_is_final to match correct first_name behavior

first_name is the first whitespace-delimited word, not everything before the
last space -- the code was right, the test (and the doc) had the wrong spec.
ZiB 3 месяцев назад
Родитель
Сommit
736c6dcd26
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      tests/test_sensors.py

+ 2 - 2
tests/test_sensors.py

@@ -125,10 +125,10 @@ def test_guest_name_three_words_last_is_final():
   coord = _coordinator(current=ReservationData(guest_name="ZiB Middle Guest"))
   s = _sensor(GuestNameSensor, coord, field="guest_name")
   attrs = s.extra_state_attributes
-  assert attrs["first_name"] == "ZiB Middle"
+  assert attrs["first_name"] == "ZiB"
   assert attrs["last_name"] == "Guest"
   assert attrs["last_abbr"] == "G"
-  assert attrs["public"] == "ZiB Middle G."
+  assert attrs["public"] == "ZiB G."
 
 
 def test_guest_name_none_returns_no_attrs():