Source

ars / tests / graphics / test_base.py

from unittest import TestCase

import mock

from ars.graphics import base


class ScreenshotRecorderTest(TestCase):

	def test_calc_filename(self):
		base_filename = mock.NonCallableMock(spec=str)
		recorder = _ScreenshotRecorderAux(base_filename)
		extension = recorder.file_extension

		self.assertEqual(
			recorder.calc_filename(),
			'%s1.%s' % (base_filename, extension))
		self.assertEqual(
			recorder.calc_filename(19323452435),
			'%s19323452435.%s' % (base_filename, extension))


class _ScreenshotRecorderAux(base.ScreenshotRecorder):

	def write(self, index, time):
		pass