Remove unnecessary files, use generic file for unrelated test.

This commit is contained in:
Ben Patterson
2015-11-22 09:35:53 -05:00
parent 484a4f2b66
commit bed5d3e8df
6 changed files with 20 additions and 27 deletions

View File

@@ -5,7 +5,6 @@ End-to-end tests related to the cohort management on the LMS Instructor Dashboar
from datetime import datetime
from path import path
from pytz import UTC, utc
from bok_choy.promise import EmptyPromise
from nose.plugins.attrib import attr
@@ -71,11 +70,6 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin
self.instructor_dashboard_page.visit()
self.cohort_management_page = self.instructor_dashboard_page.select_cohort_management()
test_dir = path(__file__).abspath().dirname().dirname().dirname().dirname()
self.files_path = test_dir + '/data/uploads/'
test_dir2 = self.instructor_dashboard_page.get_asset_path('.')
def verify_cohort_description(self, cohort_name, expected_description):
"""
Selects the cohort with the given name and verifies the expected description is presented.
@@ -323,9 +317,14 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin
)
def _create_csv_file(self, filename, csv_text_as_lists):
import csv
"""
Create a csv file with the provided list of lists.
:param filename: this is the name that will be used for the csv file. Its location will
be under the test upload data directory
:param csv_text_as_lists: provide the contents of the csv file int he form of a list of lists
"""
filename = self.instructor_dashboard_page.get_asset_path(filename)
# filename = self.files_path + filename
with open(filename, 'w+') as csv_file:
writer = csv.writer(csv_file, quoting=csv.QUOTE_ALL)
for line in csv_text_as_lists:
@@ -494,10 +493,10 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin
And appropriate events have been emitted
"""
csv_contents = [
['username','email','ignored_column','cohort'],
[self.instructor_name,'','June','ManualCohort1'],
['',self.student_email,'Spring','AutoCohort1'],
[self.other_student_name,'','Fall','ManualCohort1'],
['username', 'email', 'ignored_column', 'cohort'],
[self.instructor_name, '', 'June', 'ManualCohort1'],
['', self.student_email, 'Spring', 'AutoCohort1'],
[self.other_student_name, '', 'Fall', 'ManualCohort1'],
]
filename = "cohort_csv_both_columns_1.csv"
self._create_csv_file(filename, csv_contents)
@@ -536,7 +535,7 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin
"""
csv_contents = [
['username', 'cohort'],
[self.instructor_name,'ManualCohort1'],
[self.instructor_name, 'ManualCohort1'],
[self.student_name, 'AutoCohort1'],
[self.other_student_name, 'ManualCohort1'],
]

View File

@@ -604,7 +604,7 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest):
self.assert_default_image_has_public_access(profile_page)
profile_page.upload_file(filename='cohort_users_only_username.csv')
profile_page.upload_file(filename='generic_csv.csv')
self.assertEqual(
profile_page.profile_image_message,
"The file must be one of the following types: .gif, .png, .jpeg, .jpg."

View File

@@ -1,4 +0,0 @@
username,email,ignored_column,cohort
instructor_user,,June,ManualCohort1
,student_user@example.com,Spring,AutoCohort1
other_student_user,,Fall,ManualCohort1
1 username email ignored_column cohort
2 instructor_user June ManualCohort1
3 student_user@example.com Spring AutoCohort1
4 other_student_user Fall ManualCohort1

View File

@@ -1,5 +0,0 @@
email,cohort
instructor_user@example.com,ManualCohort1
student_user@example.com,AutoCohort1
other_student_user@example.com,ManualCohort1
1 email cohort
2 instructor_user@example.com ManualCohort1
3 student_user@example.com AutoCohort1
4 other_student_user@example.com ManualCohort1

View File

@@ -1,4 +0,0 @@
username,cohort
instructor_user,ManualCohort1
student_user,AutoCohort1
other_student_user,ManualCohort1
1 username cohort
2 instructor_user ManualCohort1
3 student_user AutoCohort1
4 other_student_user ManualCohort1

View File

@@ -0,0 +1,7 @@
column_1,column_2
foo,bar
foo,baz
hello,there
file_size,must_be_100_bytes
the story,was
very very very very very,interesting
1 column_1 column_2
2 foo bar
3 foo baz
4 hello there
5 file_size must_be_100_bytes
6 the story was
7 very very very very very interesting