<commit_before># Copyright 2012 Midokura Japan KK

import os
import sys
import unittest
from webob import exc

TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
                                   os.pardir,
                                   os.pardir,
                                   os.pardir))
sys.path.insert(0, TOPDIR)

from midonet.client import MidonetClient
from midonet import utils


class TestBridge(unittest.TestCase):

    tenent = None
    bridge = None
    bridge_uuid = None
    test_tenant_name = "TEST_TENANT"
    test_bridge_name = "TEST_BRIDGE"

    @classmethod
    def setUpClass(cls):
        mc = MidonetClient()
        cls.tenant = mc.tenants()
        cls.bridge = mc.bridges()
        cls.dhcp = mc.dhcps()

        try:
            cls.tenant.create(cls.test_tenant_name)
            r, c = cls.bridge.create(cls.test_tenant_name, cls.test_bridge_name)
            cls.bridge_uuid = utils.get_uuid(r)

        except:
            pass

    @classmethod
    def tearDownClass(cls):
        cls.tenant.delete(cls.test_tenant_name)

    def test_list(self):
        self.bridge.list(self.test_tenant_name)

    def test_create_get_delete(self):
        r, c = self.dhcp.create(self.test_tenant_name, self.bridge_uuid,
                                '172.16.0.0', 16, '172.16.0.1')<commit_msg>Remove junk and fix wrong method name<commit_after># Copyright 2012 Midokura Japan KK

import os
import sys
import unittest
from webob import exc

TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
                                   os.pardir,
                                   os.pardir,
                                   os.pardir))
sys.path.insert(0, TOPDIR)

from midonet.client import MidonetClient
from midonet import utils


class TestBridge(unittest.TestCase):

    tenent = None
    bridge = None
    bridge_uuid = None
    test_tenant_name = "TEST_TENANT"
    test_bridge_name = "TEST_BRIDGE"

    @classmethod
    def setUpClass(cls):
        mc = MidonetClient()
        cls.tenant = mc.tenants()
        cls.bridge = mc.bridges()
        cls.dhcp = mc.dhcps()

        try:
            cls.tenant.create(cls.test_tenant_name)
            r, c = cls.bridge.create(cls.test_tenant_name, cls.test_bridge_name)
            cls.bridge_uuid = utils.get_uuid(r)

        except:
            pass

    @classmethod
    def tearDownClass(cls):
        cls.tenant.delete(cls.test_tenant_name)

    def test_create_list_get_delete(self):
        r, c = self.dhcp.create(self.test_tenant_name, self.bridge_uuid,
                                '172.16.0.0', 16, '172.16.0.1')
{'fraction_non_alphanumeric': 0.09556313993174062, 'fraction_numerical': 0.016685627607129314, 'mean_word_length': 1.9707207207207207, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '216309', 'n_tokens_mistral': 905, 'n_tokens_neox': 860, 'n_words': 162}