code
stringlengths
3
6.57k
text.isMultiline(s)
self.assertTrue(m)
text.isMultiline(s)
self.assertFalse(m)
test_endsInNewline(self)
text.endsInNewline(s)
self.assertTrue(m)
text.endsInNewline(s)
self.assertFalse(m)
StringyStringTests(unittest.TestCase)
test_tuple(self)
text.stringyString(s)
self.assertEqual(m, '(a,\n b,)
test_dict(self)
str()
text.stringyString(s)
self.assertEqual(m, '{a: 0}')
test_list(self)
str()
text.stringyString(s)
self.assertEqual(m, '[a,\n b,]\n')
SplitTests(unittest.TestCase)
test_oneWord(self)
text.splitQuoted(s)
self.assertEqual(['This', 'code', 'works.'], r)
test_multiWord(self)
text.splitQuoted(s)
self.assertEqual(['The', 'hairy monkey', 'likes', 'pie.'], r)
test_preserveWhitespace(self)
text.splitQuoted(s)
self.assertEqual(['With', phrase, 'between.'], r)
test_escapedSpace(self)
text.splitQuoted(s)
self.assertEqual(["One Phrase"], r)
StrFileTests(unittest.TestCase)
setUp(self)
StringIO("this is a test string")
tearDown(self)
test_1_f(self)
self.assertEqual(False, text.strFile("x", self.io)
test_1_1(self)
self.assertEqual(True, text.strFile("t", self.io)
test_1_2(self)
self.assertEqual(True, text.strFile("h", self.io)
test_1_3(self)
self.assertEqual(True, text.strFile("i", self.io)
test_1_4(self)
self.assertEqual(True, text.strFile("s", self.io)
test_1_5(self)
self.assertEqual(True, text.strFile("n", self.io)
test_1_6(self)
self.assertEqual(True, text.strFile("g", self.io)
test_3_1(self)
self.assertEqual(True, text.strFile("thi", self.io)
test_3_2(self)
self.assertEqual(True, text.strFile("his", self.io)
test_3_3(self)
self.assertEqual(True, text.strFile("is ", self.io)
test_3_4(self)
self.assertEqual(True, text.strFile("ing", self.io)
test_3_f(self)
self.assertEqual(False, text.strFile("bla", self.io)
test_large_1(self)
self.assertEqual(True, text.strFile("this is a test", self.io)
test_large_2(self)
self.assertEqual(True, text.strFile("is a test string", self.io)
test_large_f(self)
self.assertEqual(False, text.strFile("ds jhfsa k fdas", self.io)
test_overlarge_f(self)
self.assertEqual(False, text.strFile("djhsakj dhsa fkhsa s,mdbnfsauiw bndasdf hreew", self.io)
test_self(self)
self.assertEqual(True, text.strFile("this is a test string", self.io)
test_insensitive(self)
self.assertEqual(True, text.strFile("ThIs is A test STRING", self.io, False)
Blueprint('show_bp', __name__)
show_bp.route('/', methods=['GET'])
show_bp.route('/create', methods=['GET'])
show_bp.route('/create', methods=['POST'])
CONF.import_opt('keys_path', 'nova.crypto')
extensions.os_compute_authorizer(ALIAS)
CloudpipeController(wsgi.Controller)
__init__(self)
compute.API(skip_policy_check=True)
network.API(skip_policy_check=True)
pipelib.CloudPipe(skip_policy_check=True)
self.setup()
setup(self)
NOTE(vish)
fileutils.ensure_tree(CONF.keys_path)
_get_all_cloudpipes(self, context)
pipelib.is_vpn_image(instance.image_ref)
_get_cloudpipe_for_project(self, context)
self._get_all_cloudpipes(context)
_vpn_dict(self, context, project_id, instance)
context.elevated()
timeutils.isotime(instance.created_at)
compute_utils.get_nw_info_for_instance(instance)
vif.fixed_ips()
NOTE(vish)
self.network_api.get(elevated, vif['network']['id'])