示例#1
0
 def test_safe_str(self):
     self.assertEqual(safe_str('foo'), 'foo')
     self.assertEqual(safe_str(escaped_str('foo')), escaped_str('foo'))
     self.assertEqual(safe_str(jbos('foo')).bits, jbos('foo').bits)
     self.assertRaises(NotImplementedError, safe_str, 123)
示例#2
0
 def test_literals(self):
     self.assertEqual(safe_str(literal('foo')), literal('foo'))
     self.assertEqual(safe_str(shell_literal('foo')), shell_literal('foo'))
示例#3
0
 def test_jbos(self):
     self.assertEqual(safe_str(jbos('foo')).bits, jbos('foo').bits)
示例#4
0
 def test_string(self):
     self.assertEqual(safe_str('foo'), 'foo')
示例#5
0
 def test_safe_str(self):
     self.assertEqual(safe_str('foo'), 'foo')
     self.assertEqual(safe_str(literal('foo')), literal('foo'))
     self.assertEqual(safe_str(shell_literal('foo')), shell_literal('foo'))
     self.assertEqual(safe_str(jbos('foo')).bits, jbos('foo').bits)
     self.assertRaises(NotImplementedError, safe_str, 123)