<commit_before>import unittest2 as unittest
from bda.plone.shipping.tests import (
    Shipping_INTEGRATION_TESTING,
    set_browserlayer,
)


class TestShipping(unittest.TestCase):
    layer = Shipping_INTEGRATION_TESTING

    def setUp(self):
        self.portal = self.layer['portal']
        self.request = self.layer['request']
        set_browserlayer(self.request)

    def test_foo(self):
        self.assertEquals(1, 1)<commit_msg>test shipping mock<commit_after>import unittest2 as unittest
from bda.plone.shipping.tests import (
    Shipping_INTEGRATION_TESTING,
    set_browserlayer,
)
from bda.plone.shipping import FlatRate, Shipping
from zope.component import provideAdapter
from zope.interface import Interface
from bda.plone.shipping.interfaces import IShipping


class MockShipping(Shipping):
    sid = 'mock_shipping'
    label = 'Mock Shipping'
    available = True
    default = False

    def calculate(self, items):
        return 10


class TestShipping(unittest.TestCase):
    layer = Shipping_INTEGRATION_TESTING

    def setUp(self):
        self.portal = self.layer['portal']
        self.request = self.layer['request']
        set_browserlayer(self.request)
        provideAdapter(MockShipping)
        self.shipping = IShipping(self.portal)

    def test_shipping(self):
        mock = self.shipping
        self.assertEquals(mock.sid, "mock_shipping")
        self.assertEquals(mock.label, "Mock Shipping")
        self.assertEquals(mock.available, True)
        self.assertEquals(mock.default, False)
        self.assertEquals(mock.calculate([]), 10)
{'fraction_non_alphanumeric': 0.0915982312065698, 'fraction_numerical': 0.00505369551484523, 'mean_word_length': 3.525714285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6879525', 'n_tokens_mistral': 486, 'n_tokens_neox': 473, 'n_words': 96}