def test_metadata_wrapping(self): """Check that metadata is processed and wrapped.""" test_dict = {'cool': 'dude', 'wow': 'ok'} expected_single = '<!-- @cool: dude -->\n' expected_single_comma = '<!-- @cool: dude, wow -->\n' expected_multiple = '<!-- @cool: dude -->\n<!-- @wow: ok -->\n' r = form.wrap_metadata(('cool', 'dude')) self.assertEqual(r, expected_single) r = form.wrap_metadata(('cool', 'dude, wow')) self.assertEqual(r, expected_single_comma) r = form.get_metadata(('cool', 'wow'), test_dict) self.assertEqual(r, expected_multiple)
def test_metadata_wrapping(self): """Check that metadata is processed and wrapped.""" TEST_DICT = {'cool': 'dude', 'wow': 'ok'} EXPECTED_SINGLE = '<!-- @cool: dude -->\n' EXPECTED_SINGLE_COMMA = '<!-- @cool: dude, wow -->\n' EXPECTED_MULTIPLE = '<!-- @cool: dude -->\n<!-- @wow: ok -->\n' r = form.wrap_metadata(('cool', 'dude')) self.assertEqual(r, EXPECTED_SINGLE) r = form.wrap_metadata(('cool', 'dude, wow')) self.assertEqual(r, EXPECTED_SINGLE_COMMA) r = form.get_metadata(('cool', 'wow'), TEST_DICT) self.assertEqual(r, EXPECTED_MULTIPLE)
def test_metadata_wrapping(self): """Check that metadata is processed and wrapped.""" test_dict = {'cool': 'dude', 'wow': 'ok'} expected_single = '<!-- @cool: dude -->\n' expected_single_comma = '<!-- @cool: dude, wow -->\n' expected_multiple = '<!-- @cool: dude -->\n<!-- @wow: ok -->\n' r = form.wrap_metadata(('cool', 'dude')) self.assertEqual(r, expected_single) r = form.wrap_metadata(('cool', 'dude, wow')) self.assertEqual(r, expected_single_comma) r = form.get_metadata(('cool', 'wow'), test_dict) self.assertEqual(r, expected_multiple)
def test_metadata_wrapping(self): '''Make sure wrap_metadata and get_metadata methods work.''' TEST_DICT = {'cool': 'dude', 'wow': 'ok'} EXPECTED_SINGLE = '<!-- @cool: dude -->\n' EXPECTED_MULTIPLE = '<!-- @cool: dude -->\n<!-- @wow: ok -->\n' r = form.wrap_metadata(('cool', 'dude')) self.assertEqual(r, EXPECTED_SINGLE) r = form.get_metadata(('cool', 'wow'), TEST_DICT) self.assertEqual(r, EXPECTED_MULTIPLE)
def test_metadata_wrapping(self): '''Make sure wrap_metadata and get_metadata methods work.''' TEST_DICT = {'cool': 'dude', 'wow': 'ok'} EXPECTED_SINGLE = '<!-- @cool: dude -->\n' EXPECTED_MULTIPLE = '<!-- @cool: dude -->\n<!-- @wow: ok -->\n' r = form.wrap_metadata(('cool', 'dude')) self.assertEqual(r, EXPECTED_SINGLE) r = form.get_metadata(('cool', 'wow'), TEST_DICT) self.assertEqual(r, EXPECTED_MULTIPLE)
def test_metadata_wrapping(self): """Checks that metadata is processed and wrapped.""" TEST_DICT = {'cool': 'dude', 'wow': 'ok'} EXPECTED_SINGLE = '<!-- @cool: dude -->\n' EXPECTED_MULTIPLE = '<!-- @cool: dude -->\n<!-- @wow: ok -->\n' r = form.wrap_metadata(('cool', 'dude')) self.assertEqual(r, EXPECTED_SINGLE) r = form.get_metadata(('cool', 'wow'), TEST_DICT) self.assertEqual(r, EXPECTED_MULTIPLE)
def prepare_private_url(private_url): """Create metadata with private url""" return "\n" + wrap_metadata(('private_url', private_url))