def test_write_start_contenetline(self): out = six.BytesIO() writer = CalendarWriter(out) writer.start_contentline("foo") self.assertEqual(out.getvalue(), b"foo:")
def test_begin(self): writer = CalendarWriter(six.BytesIO()) writer.start_contentline = MagicMock() writer.value = MagicMock() writer.end_contentline = MagicMock() writer.begin(sentinel.section) writer.start_contentline.assert_called_once_with("BEGIN") writer.value.assert_called_once_with(sentinel.section) writer.end_contentline.assert_called_once()
def test_contentline(self): writer = CalendarWriter(six.BytesIO()) writer.start_contentline = MagicMock() writer.value = MagicMock() writer.end_contentline = MagicMock() writer.contentline(sentinel.name, sentinel.value) writer.start_contentline.assert_called_once_with(sentinel.name) writer.value.assert_called_once_with(sentinel.value) writer.end_contentline.assert_called_once()