コード例 #1
0
    def test_activity_state_active_for_4(self) -> None:
        basdai = Basdai()

        with mock.patch.object(basdai, "basdai") as mock_basdai:
            mock_basdai.return_value = 4
            with mock.patch.object(basdai, "wxstring") as mock_wxstring:
                basdai.activity_state(self.request)

        mock_wxstring.assert_called_once_with(self.request, "active")
コード例 #2
0
    def test_activity_state_qmark_for_none(self) -> None:
        basdai = Basdai()

        with mock.patch.object(basdai, "basdai") as mock_basdai:
            mock_basdai.return_value = None
            self.assertEqual(basdai.activity_state(self.request), "?")