Ejemplo n.º 1
0
	def test_decade(self):
		res = quantizer.get_metadata(dummy.data['test'])
		self.assertNotEqual(None, res)
		self.assertFalse('year' in res)
		self.assertTrue('decade' in res)
		self.assertEqual("1970", res['decade'])
		self.assertEqual("1970s", res['decades'])
Ejemplo n.º 2
0
	def test_release_date_organize(self):
		dummy.data['test']['release_date]'] = "1979-09-06"
		res = quantizer.get_metadata(dummy.data['test'])	
		medialinkfs.organize.organize_set({}, self.settings)
		self.assertTrue(os.path.isdir(os.path.join(self.tmpdir, "Year", "1979")))
		self.assertTrue(os.path.isdir(os.path.join(self.tmpdir, "Decade", "1970")))
		self.assertTrue(os.path.isdir(os.path.join(self.tmpdir, "Decades", "1970s")))
Ejemplo n.º 3
0
	def test_release_date(self):
		res = {"release_date":"2012-09-06"}
		res = quantizer.get_metadata(res)
		self.assertTrue('year' in res)
		self.assertEqual(2012, res['year'])
		self.assertTrue('decade' in res)
		self.assertEqual('2010', res['decade'])
		self.assertEqual('2010s', res['decades'])
Ejemplo n.º 4
0
	def test_empty_decade(self):
		del dummy.data['test']['year']
		res = quantizer.get_metadata(dummy.data['test'])
		self.assertNotEqual(None, res)
		self.assertFalse('decade' in res)
Ejemplo n.º 5
0
	def test_ratings(self):
		res = {"rating":"8.3"}
		res = quantizer.get_metadata(res)
		self.assertEqual('8.5', res['ratings'])
Ejemplo n.º 6
0
	def test_letters_special(self):
		res = {"name":"1234 This is a movie"}
		res = quantizer.get_metadata(res)
		self.assertEqual('0', res['letter'])
Ejemplo n.º 7
0
	def test_letters(self):
		res = {"name":"This is a movie"}
		res = quantizer.get_metadata(res)
		self.assertEqual('T', res['letter'])