input stringlengths 11 7.65k | target stringlengths 22 8.26k |
|---|---|
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def main():
import io
import sys
import argparse
from .__init__ import __version__
from femagtools.bch import Reader
argparser = argparse.ArgumentParser(
description='Read BCH/BATCH/PLT file and create a plot')
argparser.add_argument('filename',
help='name... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def characteristics(char, title=''):
fig, axs = plt.subplots(2, 2, figsize=(10, 8), sharex=True)
if title:
fig.suptitle(title)
n = np.array(char['n'])*60
pmech = np.array(char['pmech'])*1e-3
axs[0, 0].plot(n, np.array(char['T']), 'C0-', label='Torque')
axs[0, 0].set_ylabel("Torque / Nm... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def runcmd(cmd, **kw): # same code as in getlino.py
"""Run the cmd similar as os.system(), but stop when Ctrl-C."""
# kw.update(stdout=subprocess.PIPE)
# kw.update(stderr=subprocess.STDOUT)
kw.update(shell=True)
kw.update(universal_newlines=True)
kw.update(check=True)
# subprocess.check_out... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def add_arguments(self, parser):
parser.add_argument('--noinput', action='store_false',
dest='interactive', default=True,
help='Do not prompt for input of any kind.')
parser.add_argument('-l', '--list', action='store_true',
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_watch_task(client):
user = f.UserFactory.create()
task = f.create_task(owner=user, milestone=None)
f.MembershipFactory.create(project=task.project, user=user, is_admin=True)
url = reverse("tasks-watch", args=(task.id,))
client.login(user)
response = client.post(url)
assert respons... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_unwatch_task(client):
user = f.UserFactory.create()
task = f.create_task(owner=user, milestone=None)
f.MembershipFactory.create(project=task.project, user=user, is_admin=True)
url = reverse("tasks-watch", args=(task.id,))
client.login(user)
response = client.post(url)
assert respo... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_list_task_watchers(client):
user = f.UserFactory.create()
task = f.TaskFactory(owner=user)
f.MembershipFactory.create(project=task.project, user=user, is_admin=True)
f.WatchedFactory.create(content_object=task, user=user)
url = reverse("task-watchers-list", args=(task.id,))
client.logi... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_get_task_watcher(client):
user = f.UserFactory.create()
task = f.TaskFactory(owner=user)
f.MembershipFactory.create(project=task.project, user=user, is_admin=True)
watch = f.WatchedFactory.create(content_object=task, user=user)
url = reverse("task-watchers-detail", args=(task.id, watch.user... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_get_task_watchers(client):
user = f.UserFactory.create()
task = f.TaskFactory(owner=user)
f.MembershipFactory.create(project=task.project, user=user, is_admin=True)
url = reverse("tasks-detail", args=(task.id,))
f.WatchedFactory.create(content_object=task, user=user)
client.login(user... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_get_task_is_watcher(client):
user = f.UserFactory.create()
task = f.create_task(owner=user, milestone=None)
f.MembershipFactory.create(project=task.project, user=user, is_admin=True)
url_detail = reverse("tasks-detail", args=(task.id,))
url_watch = reverse("tasks-watch", args=(task.id,))
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def __init__(self):
self.var = 0 |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def connect ():
'''
Create the connection to the MongoDB and create 3 collections needed
'''
try:
# Create the connection to the local host
conn = pymongo.MongoClient()
print 'MongoDB Connection Successful'
except pymongo.errors.ConnectionFailure, err:
print 'MongoDB... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def __init__(self):
self.var = 1 # self.var will be overwritten
C.__init__(self) |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def __init__(self):
self.var = 0 # self.var will be overwritten |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def make_new_rsa_key_weak(bits):
return RSA.generate(bits) # NOT OK |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def _build_gravatar_url(email, params):
"""Generate a Gravatar URL. |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def make_new_rsa_key_strong(bits):
return RSA.generate(bits) # OK |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def __init__(self, email, params):
self.email = email
self.params = params |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def render(self, context):
try:
if self.params:
params = template.Variable(self.params).resolve(context)
else:
params = {}
# try matching an address string literal
email_literal = self.email.strip().lower()
if EMAIL_RE.... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def __init__(self): # pylint: disable=super-init-not-called
pass |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_parse_sections():
simple_mariofile_sections = dict(mariofile.parse_sections(SIMPLE_MARIOFILE.splitlines(True)))
assert len(simple_mariofile_sections) == 3
complex_mariofile_sections = dict(mariofile.parse_sections(COMPLEX_MARIOFILE.splitlines(True)))
assert len(complex_mariofile_sections) == 2
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def setUp(self):
super(BaseSuggestionUnitTests, self).setUp()
self.base_suggestion = MockInvalidSuggestion() |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_statements():
with pytest.raises(mariofile.ConfigurationFileError):
mariofile.parse_section_body(CRASH_MARIOFILE_1.splitlines())
with pytest.raises(mariofile.ConfigurationFileError):
mariofile.parse_section_body(CRASH_MARIOFILE_2.splitlines()) |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_base_class_accept_raises_error(self):
with self.assertRaisesRegex(
NotImplementedError,
'Subclasses of BaseSuggestion should implement accept.'):
self.base_suggestion.accept() |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_parse_statements():
parsed_statement = mariofile.parse_statements(STRING_PARSE_STATEMENTS.splitlines())
assert '\n'.join(parsed_statement) == "statement\nstatement con commento" |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_base_class_get_change_list_for_accepting_suggestion_raises_error(
self):
with self.assertRaisesRegex(
NotImplementedError,
'Subclasses of BaseSuggestion should implement '
'get_change_list_for_accepting_suggestion.'):
self.base_suggestion.get_... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_parse_section_body():
output_section = {
'action_template': ' task',
'sources_repls': 'source',
'variable': '6',
'target_pattern': 'target',
}
assert mariofile.parse_section_body(SECTION.splitlines(True)) == output_section
with pytest.raises(mariofile.Configur... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_base_class_pre_accept_validate_raises_error(self):
with self.assertRaisesRegex(
NotImplementedError,
'Subclasses of BaseSuggestion should implement'
' pre_accept_validate.'):
self.base_suggestion.pre_accept_validate() |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_parse_include():
filepaths, current_line = mariofile.parse_include(INCLUDE_FILE.splitlines(True))
assert filepaths == ['prova.ini', 'altrofile.ini']
assert current_line == 4
filepaths, current_line = mariofile.parse_include(INCLUDE_UNIQUE_FILE.splitlines(True))
assert filepaths == ['prova.i... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_base_class_populate_old_value_of_change_raises_error(self):
with self.assertRaisesRegex(
NotImplementedError,
'Subclasses of BaseSuggestion should implement'
' populate_old_value_of_change.'):
self.base_suggestion.populate_old_value_of_change() |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_base_class_pre_update_validate_raises_error(self):
with self.assertRaisesRegex(
NotImplementedError,
'Subclasses of BaseSuggestion should implement'
' pre_update_validate.'):
self.base_suggestion.pre_update_validate({}) |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_base_class_get_all_html_content_strings(self):
with self.assertRaisesRegex(
NotImplementedError,
'Subclasses of BaseSuggestion should implement'
' get_all_html_content_strings.'):
self.base_suggestion.get_all_html_content_strings() |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_base_class_get_target_entity_html_strings(self):
with self.assertRaisesRegex(
NotImplementedError,
'Subclasses of BaseSuggestion should implement'
' get_target_entity_html_strings.'):
self.base_suggestion.get_target_entity_html_strings() |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def setUp(self):
super(SuggestionEditStateContentUnitTests, self).setUp()
self.signup(self.AUTHOR_EMAIL, 'author')
self.author_id = self.get_user_id_from_email(self.AUTHOR_EMAIL)
self.signup(self.REVIEWER_EMAIL, 'reviewer')
self.reviewer_id = self.get_user_id_from_email(self.REV... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_create_suggestion_edit_state_content(self):
expected_suggestion_dict = self.suggestion_dict
observed_suggestion = suggestion_registry.SuggestionEditStateContent(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_sugge... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_get_score_part_helper_methods(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionEditStateContent(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['targ... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_target_version_at_submission(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionEditStateContent(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dic... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_author_id_format(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionEditStateContent(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['target_ve... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_final_reviewer_id_format(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionEditStateContent(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['t... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_populate_old_value_of_change_with_invalid_state(self):
self.save_new_default_exploration('exp1', self.author_id)
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionEditStateContent(
expected_suggestion_dict['suggestion_id'],
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_pre_update_validate_change_new_value(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionEditStateContent(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_convert_html_in_suggestion_change(self):
html_content = (
'<p>Value</p><oppia-noninteractive-math raw_latex-with-value="&a'
'mp;quot;+,-,-,+&quot;"></oppia-noninteractive-math>')
expected_html_content = (
'<p>Value</p><oppia-noninteractive-math math_conte... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def setUp(self):
super(SuggestionTranslateContentUnitTests, self).setUp()
self.signup(self.AUTHOR_EMAIL, 'author')
self.author_id = self.get_user_id_from_email(self.AUTHOR_EMAIL)
self.signup(self.REVIEWER_EMAIL, 'reviewer')
self.reviewer_id = self.get_user_id_from_email(self.REV... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_create_suggestion_add_translation(self):
expected_suggestion_dict = self.suggestion_dict
observed_suggestion = suggestion_registry.SuggestionTranslateContent(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggesti... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_get_score_part_helper_methods(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionTranslateContent(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['targ... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_author_id(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionTranslateContent(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['target_version_a... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_author_id_format(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionTranslateContent(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['target_ve... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_pre_accept_validate_state_name(self):
self.save_new_default_exploration('exp1', self.author_id)
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionTranslateContent(
expected_suggestion_dict['suggestion_id'],
expected_sugges... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_accept_suggestion_adds_translation_in_exploration(self):
self.save_new_default_exploration('exp1', self.author_id)
exploration = exp_fetchers.get_exploration_by_id('exp1')
self.assertEqual(exploration.get_translation_counts(), {})
suggestion = suggestion_registry.SuggestionTrans... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_accept_suggestion_with_set_of_string_adds_translation(self):
self.save_new_default_exploration('exp1', self.author_id)
exploration = exp_fetchers.get_exploration_by_id('exp1')
self.assertEqual(exploration.get_translation_counts(), {})
suggestion = suggestion_registry.SuggestionT... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_accept_suggestion_with_psedonymous_author_adds_translation(self):
self.save_new_default_exploration('exp1', self.author_id)
exploration = exp_fetchers.get_exploration_by_id('exp1')
self.assertEqual(exploration.get_translation_counts(), {})
expected_suggestion_dict = self.sugge... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_convert_html_in_suggestion_change(self):
html_content = (
'<p>Value</p><oppia-noninteractive-math raw_latex-with-value="&a'
'mp;quot;+,-,-,+&quot;"></oppia-noninteractive-math>')
expected_html_content = (
'<p>Value</p><oppia-noninteractive-math math_conte... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def setUp(self):
super(SuggestionAddQuestionTest, self).setUp()
self.signup(self.AUTHOR_EMAIL, 'author')
self.author_id = self.get_user_id_from_email(self.AUTHOR_EMAIL)
self.signup(self.REVIEWER_EMAIL, 'reviewer')
self.reviewer_id = self.get_user_id_from_email(self.REVIEWER_EMAI... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_create_suggestion_add_question(self):
expected_suggestion_dict = self.suggestion_dict
observed_suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict[... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_get_score_part_helper_methods(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['target_ve... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_score_type(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['target_version_at_s... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_change_question_dict(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['target_ve... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_change_question_state_data_schema_version(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_sugge... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_change_skill_difficulty_none(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['ta... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_change_skill_difficulty_invalid_value(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_pre_accept_validate_change_skill_id(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['tar... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_pre_accept_validate_change_invalid_skill_id(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_d... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_get_change_list_for_accepting_suggestion(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_populate_old_value_of_change(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['target_ver... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_cannot_accept_suggestion_with_invalid_skill_id(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestio... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_pre_update_validate_change_cmd(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['target_v... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_pre_update_validate_change_skill_id(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['tar... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_pre_update_validate_complains_if_nothing_changed(self):
change = {
'cmd': question_domain.CMD_CREATE_NEW_FULLY_SPECIFIED_QUESTION,
'question_dict': {
'question_state_data': self._create_valid_question_data(
'default_state').to_dict(),
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_pre_update_validate_accepts_a_change_in_skill_difficulty_only(
self):
change = {
'cmd': question_domain.CMD_CREATE_NEW_FULLY_SPECIFIED_QUESTION,
'question_dict': {
'question_state_data': self._create_valid_question_data(
'default_s... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_pre_update_validate_accepts_a_change_in_state_data_only(self):
change = {
'cmd': question_domain.CMD_CREATE_NEW_FULLY_SPECIFIED_QUESTION,
'question_dict': {
'question_state_data': self._create_valid_question_data(
'default_state').to_dict(),
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_author_id(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['target_version_at_sub... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_author_id_format(self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
expected_suggestion_dict['target_version... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validate_language_code_fails_when_language_codes_do_not_match(
self):
expected_suggestion_dict = self.suggestion_dict
suggestion = suggestion_registry.SuggestionAddQuestion(
expected_suggestion_dict['suggestion_id'],
expected_suggestion_dict['target_id'],
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_convert_html_in_suggestion_change(self):
html_content = (
'<p>Value</p><oppia-noninteractive-math raw_latex-with-value="&a'
'mp;quot;+,-,-,+&quot;"></oppia-noninteractive-math>')
expected_html_content = (
'<p>Value</p><oppia-noninteractive-math math_conte... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_accept_suggestion_with_images(self):
html_content = (
'<p>Value</p><oppia-noninteractive-math math_content-with-value='
'"{&quot;raw_latex&quot;: &quot;+,-,-,+&quot;, &'
'amp;quot;svg_filename&quot;: &quot;img.svg&quot;}">'
'</... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_accept_suggestion_with_image_region_interactions(self):
with utils.open_file(
os.path.join(feconf.TESTS_DATA_DIR, 'img.png'), 'rb',
encoding=None) as f:
original_image_content = f.read()
fs_services.save_original_and_compressed_versions_of_image(
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_contructor_updates_state_shema_in_change_cmd(self):
score_category = (
suggestion_models.SCORE_TYPE_QUESTION +
suggestion_models.SCORE_CATEGORY_DELIMITER + 'skill_id')
change = {
'cmd': (
question_domain
.CMD_CREATE_NEW_FULLY_S... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_contructor_raise_exception_for_invalid_state_shema_version(self):
score_category = (
suggestion_models.SCORE_TYPE_QUESTION +
suggestion_models.SCORE_CATEGORY_DELIMITER + 'skill_id')
change = {
'cmd': (
question_domain
.CMD_CREA... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def setUp(self):
super(BaseVoiceoverApplicationUnitTests, self).setUp()
self.base_voiceover_application = MockInvalidVoiceoverApplication() |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_base_class_init_raises_error(self):
with self.assertRaisesRegex(
NotImplementedError,
'Subclasses of BaseVoiceoverApplication should implement '
'__init__.'):
suggestion_registry.BaseVoiceoverApplication() |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_base_class_accept_raises_error(self):
with self.assertRaisesRegex(
NotImplementedError,
'Subclasses of BaseVoiceoverApplication should implement accept.'):
self.base_voiceover_application.accept() |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_base_class_reject_raises_error(self):
with self.assertRaisesRegex(
NotImplementedError,
'Subclasses of BaseVoiceoverApplication should implement reject.'):
self.base_voiceover_application.reject() |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def setUp(self):
super(ExplorationVoiceoverApplicationUnitTest, self).setUp()
self.signup('author@example.com', 'author')
self.author_id = self.get_user_id_from_email('author@example.com')
self.signup('reviewer@example.com', 'reviewer')
self.reviewer_id = self.get_user_id_from_e... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validation_for_handled_application_with_invalid_final_review(self):
self.assertEqual(
self.voiceover_application.status,
suggestion_models.STATUS_IN_REVIEW)
self.assertEqual(self.voiceover_application.final_reviewer_id, None)
self.voiceover_application.validate()... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validation_for_rejected_application_with_no_message(self):
self.assertEqual(
self.voiceover_application.status,
suggestion_models.STATUS_IN_REVIEW)
self.assertEqual(self.voiceover_application.rejection_message, None)
self.voiceover_application.validate()
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_validation_with_invalid_language_code_type_raise_exception(self):
self.assertEqual(self.voiceover_application.language_code, 'en')
self.voiceover_application.validate()
self.voiceover_application.language_code = 1
with self.assertRaisesRegex(
utils.ValidationError, ... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_to_dict_returns_correct_dict(self):
self.voiceover_application.accept(self.reviewer_id)
expected_dict = {
'voiceover_application_id': 'application_id',
'target_type': 'exploration',
'target_id': 'exp_id',
'status': 'accepted',
'author_... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_is_handled_property_returns_correct_value(self):
self.assertFalse(self.voiceover_application.is_handled)
self.voiceover_application.accept(self.reviewer_id)
self.assertTrue(self.voiceover_application.is_handled) |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_accept_voiceover_application(self):
self.assertEqual(self.voiceover_application.final_reviewer_id, None)
self.assertEqual(self.voiceover_application.status, 'review')
self.voiceover_application.accept(self.reviewer_id)
self.assertEqual(
self.voiceover_application.f... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_reject_voiceover_application(self):
self.assertEqual(self.voiceover_application.final_reviewer_id, None)
self.assertEqual(self.voiceover_application.status, 'review')
self.voiceover_application.reject(self.reviewer_id, 'rejection message')
self.assertEqual(
self.vo... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def _assert_community_contribution_stats_is_in_default_state(self):
"""Checks if the community contribution stats is in its default
state.
"""
community_contribution_stats = (
suggestion_services.get_community_contribution_stats()
)
self.assertEqual(
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_initial_object_with_valid_arguments_has_correct_properties(self):
community_contribution_stats = (
suggestion_registry.CommunityContributionStats(
self.translation_reviewer_counts_by_lang_code,
self.translation_suggestion_counts_by_lang_code,
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_set_translation_reviewer_count_for_lang_code_adds_new_lang_key(
self):
community_contribution_stats = (
suggestion_services.get_community_contribution_stats()
)
self._assert_community_contribution_stats_is_in_default_state()
(
community_contri... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_get_translation_language_codes_that_need_reviewers_for_one_lang(
self):
stats = suggestion_services.get_community_contribution_stats()
stats.set_translation_suggestion_count_for_language_code(
self.sample_language_code, 1)
language_codes_that_need_reviewers = (
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_get_translation_language_codes_that_need_reviewers_for_multi_lang(
self):
stats = suggestion_services.get_community_contribution_stats()
stats.set_translation_suggestion_count_for_language_code('hi', 1)
stats.set_translation_suggestion_count_for_language_code('fr', 1)
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_get_translation_language_codes_that_need_reviewers_for_no_lang(
self):
stats = suggestion_services.get_community_contribution_stats()
language_codes_that_need_reviewers = (
stats.get_translation_language_codes_that_need_reviewers()
)
self.assertEqual(
... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_question_reviewers_are_needed_if_suggestions_zero_reviewers(
self):
stats = suggestion_services.get_community_contribution_stats()
stats.question_suggestion_count = 1
self.assertTrue(stats.are_question_reviewers_needed()) |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_question_reviewers_are_needed_if_num_suggestions_past_max(self):
stats = suggestion_services.get_community_contribution_stats()
stats.question_suggestion_count = 2
stats.question_reviewer_count = 1
config_services.set_property(
'committer_id', 'max_number_of_suggesti... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_question_reviewers_not_needed_if_num_suggestions_eqs_max(self):
stats = suggestion_services.get_community_contribution_stats()
stats.question_suggestion_count = 2
stats.question_reviewer_count = 2
config_services.set_property(
'committer_id', 'max_number_of_suggestio... |
def emit(self, level, message):
raise NotImplementedError('Please implement an emit method') | def test_question_reviewers_not_needed_if_num_suggestions_less_max(self):
stats = suggestion_services.get_community_contribution_stats()
stats.question_suggestion_count = 1
stats.question_reviewer_count = 2
config_services.set_property(
'committer_id', 'max_number_of_suggesti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.