From 27492fd8c6eb58b4554a68822fe4e63029329d95 Mon Sep 17 00:00:00 2001 From: Rafael Caricio Date: Sat, 18 Jul 2015 22:36:24 +0200 Subject: [PATCH] Remove useless code --- django_pyvows/context.py | 4 +- vows/context_vows.py | 10 ----- vows/server_vows.py | 80 ---------------------------------------- 3 files changed, 2 insertions(+), 92 deletions(-) delete mode 100644 vows/server_vows.py diff --git a/django_pyvows/context.py b/django_pyvows/context.py index 7638425..3cc1502 100644 --- a/django_pyvows/context.py +++ b/django_pyvows/context.py @@ -33,8 +33,8 @@ class DjangoContext(Vows.Context): def __init__(self, parent): super(DjangoContext, self).__init__(parent) - self.ignore('get_settings', 'template', 'request', 'model', 'url', 'find_in_parent', - 'start_environment', 'settings', 'modify_settings', 'get_url', 'get', 'post') + self.ignore('template', 'request', 'model', 'url', 'find_in_parent', + 'start_environment', 'settings', 'modify_settings', 'get', 'post') def settings(self, **kwargs): from django.test.utils import override_settings diff --git a/vows/context_vows.py b/vows/context_vows.py index 68f915a..aa32940 100644 --- a/vows/context_vows.py +++ b/vows/context_vows.py @@ -29,13 +29,3 @@ class ContextTest(Vows.Context): def should_have_nice_error_message(self, topic): expect(topic).to_have_an_error_message_of('The settings_path argument is required.') - - class WithinANoDjangoContext(Vows.Context): - - class TheGetUrlMethod(DjangoContext): - - def topic(self): - return self.get_url('/') - - def should_return_the_same_path(self, topic): - expect(topic).to_equal('/') diff --git a/vows/server_vows.py b/vows/server_vows.py deleted file mode 100644 index 8c998e0..0000000 --- a/vows/server_vows.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# django-pyvows extensions -# https://github.com/rafaelcaricio/django-pyvows - -# Licensed under the MIT license: -# http://www.opensource.org/licenses/mit-license -# Copyright (c) 2011 Rafael Caricio rafael@caricio.com - -from os.path import abspath, join, dirname - -from django_pyvows.context import DjangoContext, DjangoHTTPContext -from django_pyvows.assertions import * # NOQA - -TEST_FILE_PATH = abspath(join(dirname(__file__), 'fixtures/the_file.txt')) - -DjangoContext.start_environment("sandbox.settings") - - -@Vows.batch -class HttpContextVows(DjangoHTTPContext): - - def topic(self): - self.start_server() - return self.get("/") - - def the_return_code_should_be_200(self, (topic, content)): - expect(topic.status).to_equal(200) - - def should_return_the_success_response(self, (topic, content)): - expect(content).to_equal("hello world") - - class Methods(DjangoContext): - - def topic(self): - return self.get('/?name=rafael') - - def should_be_possible_to_pass_get_parameters(self, (topic, content)): - expect(topic.status).to_equal(200) - - class AskMyName(DjangoContext): - - def topic(self): - return self.get('/say/') - - def should_ask_for_my_name(self, (topic, content)): - expect(content).to_equal('What\'s your name?') - - class SayHelloToMe(DjangoContext): - - def topic(self): - return self.get('/say/?name=Rafael') - - def should_say_hello_to_me(self, (topic, content)): - expect(content).to_equal('Hello, Rafael!') - - class PostIt(DjangoContext): - - def topic(self): - return self.post('/post_it/', {'value': 'posted!'}) - - def should_be_posted(self, (topic, content)): - expect(content).to_equal('posted!') - - class PostFile(DjangoContext): - - def topic(self): - return self.post('/post_file/', {'the_file': open(TEST_FILE_PATH)}) - - def should_be_posted_to_the_server(self, (topic, content)): - expect(content).to_equal("the contents") - - class PostToNotFound(DjangoContext): - - def topic(self): - return self.post('/post_/', {'the_file': open(TEST_FILE_PATH)}) - - def should_be_404(self, (topic, content)): - expect(topic.status).to_equal(404)