Example #1
0
    def test_max_age_can_be_different_dependeing_methods(self):
        foo = Service(name="foo", path="/foo", cors_max_age=42)
        foo.add_view("GET", _stub)
        foo.add_view("POST", _stub, cors_max_age=32)
        foo.add_view("PUT", _stub, cors_max_age=7)

        self.assertEqual(foo.cors_max_age_for("GET"), 42)
        self.assertEqual(foo.cors_max_age_for("POST"), 32)
        self.assertEqual(foo.cors_max_age_for("PUT"), 7)
Example #2
0
    def test_max_age_can_be_different_dependeing_methods(self):
        foo = Service(name='foo', path='/foo', cors_max_age=42)
        foo.add_view('GET', _stub)
        foo.add_view('POST', _stub, cors_max_age=32)
        foo.add_view('PUT', _stub, cors_max_age=7)

        self.assertEqual(foo.cors_max_age_for('GET'), 42)
        self.assertEqual(foo.cors_max_age_for('POST'), 32)
        self.assertEqual(foo.cors_max_age_for('PUT'), 7)
Example #3
0
    def test_max_age_can_be_different_dependeing_methods(self):
        foo = Service(name='foo', path='/foo', cors_max_age=42)
        foo.add_view('GET', _stub)
        foo.add_view('POST', _stub, cors_max_age=32)
        foo.add_view('PUT', _stub, cors_max_age=7)

        self.assertEqual(foo.cors_max_age_for('GET'), 42)
        self.assertEqual(foo.cors_max_age_for('POST'), 32)
        self.assertEqual(foo.cors_max_age_for('PUT'), 7)
Example #4
0
 def test_max_age_can_be_defined(self):
     foo = Service(name="foo", path="/foo", cors_max_age=42)
     foo.add_view("POST", _stub)
     self.assertEqual(foo.cors_max_age_for(), 42)
Example #5
0
 def test_max_age_is_none_if_undefined(self):
     foo = Service(name="foo", path="/foo")
     foo.add_view("POST", _stub)
     self.assertIsNone(foo.cors_max_age_for("POST"))
Example #6
0
 def test_max_age_can_be_defined(self):
     foo = Service(name='foo', path='/foo', cors_max_age=42)
     foo.add_view('POST', _stub)
     self.assertEqual(foo.cors_max_age_for(), 42)
Example #7
0
 def test_max_age_is_none_if_undefined(self):
     foo = Service(name='foo', path='/foo')
     foo.add_view('POST', _stub)
     self.assertIsNone(foo.cors_max_age_for('POST'))
Example #8
0
 def test_max_age_can_be_defined(self):
     foo = Service(name='foo', path='/foo', cors_max_age=42)
     foo.add_view('POST', _stub)
     self.assertEqual(foo.cors_max_age_for(), 42)
Example #9
0
 def test_max_age_is_none_if_undefined(self):
     foo = Service(name='foo', path='/foo')
     foo.add_view('POST', _stub)
     self.assertIsNone(foo.cors_max_age_for('POST'))
Example #10
0
 def test_max_age_can_be_defined(self):
     foo = Service(name='foo', path='/foo', cors_max_age=42)
     self.assertEqual(foo.cors_max_age_for(), 42)
Example #11
0
 def test_max_age_can_be_defined(self):
     foo = Service(name='foo', path='/foo', cors_max_age=42)
     self.assertEquals(foo.cors_max_age_for(), 42)
Example #12
0
 def test_max_age_can_be_defined(self):
     foo = Service(name="foo", path="/foo", cors_max_age=42)
     self.assertEqual(foo.cors_max_age_for(), 42)