focal_file stringlengths 6 102 | focal_class stringclasses 430
values | focal_method stringlengths 1 69 | tests stringlengths 104 38.8k | method_code stringlengths 29 35.8k | context stringlengths 38 11.2k | repository stringclasses 673
values | test_name stringlengths 0 118 | smells listlengths 18 18 | smell_labels listlengths 18 18 | smells_isolated listlengths 18 18 | pynose_source_file stringlengths 14 81 |
|---|---|---|---|---|---|---|---|---|---|---|---|
app/models.py | User | avatar | import unittest
class Test_User_avatar(unittest.TestCase):
def test_avatar(self):
u = User(nickname='john', email='john@example.com')
avatar = u.avatar(128)
expected = 'http://www.gravatar.com/avatar/d4c74594d841139328695756648b6bd6'
assert avatar[0:len(expected)] == expected
| def avatar(self, size):
"""
by using a method to return the avatar image, this allows us to update this function later if gravatar is not used in the future
:param size:
:return:
"""
return 'http://www.gravatar.com/avatar/%s?d=mm&s=%d' % (md5(self.emai... | class User(db.Model):
def avatar(self, size): ...
def follow(self, user): ...
def unfollow(self, user): ...
def sorted_posts(self): ...
def is_following(self, user): ...
def followed_posts(self): ...
def is_authenticated(self): ...
def is_active(self): ...
def is_anonymous(self): ...... | huynle/flask_blog | test_avatar | [
1,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000001.py |
app/models.py | User | make_unique_nickname | import unittest
class Test_User_make_unique_nickname(unittest.TestCase):
def test_make_unique_nickname(self):
u = User(nickname='john', email='john@example.com')
db.session.add(u)
db.session.commit()
nickname = User.make_unique_nickname('john')
assert nickname != 'john'
... | def make_unique_nickname(nickname):
if User.query.filter_by(nickname=nickname).first() is None:
return None
version = 2
while True:
new_nickname = nickname + str(version)
if User.query.filter_by(nickname=new_nickname).first() is None:
break... | class User(db.Model):
@staticmethod
def make_unique_nickname(nickname): ...
def follow(self, user): ...
def unfollow(self, user): ...
def sorted_posts(self): ...
def is_following(self, user): ...
def followed_posts(self): ...
def is_authenticated(self): ...
def is_active(self): ...
... | huynle/flask_blog | test_make_unique_nickname | [
1,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000002.py |
app/models.py | User | follow | import unittest
class Test_User_follow(unittest.TestCase):
def test_follow(self):
u1 = User(nickname='john', email='john@example.com')
u2 = User(nickname='susan', email='susan@example.com')
db.session.add(u1)
db.session.add(u2)
db.session.commit()
assert u1.unfollow(... | def follow(self, user):
"""
returns None when fail
:param user:
:return:
"""
if not self.is_following(user):
self.followed.append(user)
return self
| class User(db.Model):
def follow(self, user): ...
def unfollow(self, user): ...
def sorted_posts(self): ...
def is_following(self, user): ...
def followed_posts(self): ...
def is_authenticated(self): ...
def is_active(self): ...
def is_anonymous(self): ...
def get_id(self): ...
d... | huynle/flask_blog | test_follow | [
1,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000003.py |
app/models.py | User | followed_posts | import unittest
class Test_User_followed_posts(unittest.TestCase):
def test_follow_posts(self):
u1 = User(nickname='john', email='john@example.com')
u2 = User(nickname='susan', email='susan@example.com')
u3 = User(nickname='mary', email='mary@example.com')
u4 = User(nickname='david'... | def followed_posts(self):
"""
This query has three parts, join, filter and order_by
:return:
"""
return Post.query.join(followers, followers.c.followed_id == Post.user_id).filter(followers.c.follower_id == self.id).order_by(Post.timestamp.desc())
| class User(db.Model):
def followed_posts(self): ...
def follow(self, user): ...
def unfollow(self, user): ...
def sorted_posts(self): ...
def is_following(self, user): ...
def is_authenticated(self): ...
def is_active(self): ...
def is_anonymous(self): ...
def get_id(self): ...
d... | huynle/flask_blog | test_follow_posts | [
1,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0
] | test_000004.py |
python_c_extension/c_extension_gil.py | null | run_count_in_single_thread | import unittest
class Test_run_count_in_single_thread(unittest.TestCase):
def test_run_count_in_single_thread(self):
time_taken = run_count_in_single_thread()
self.assertGreater(time_taken, 0)
def test_count_multiple_thread_faster_than_single_thread(self):
single_thread_time_taken = ru... | def run_count_in_single_thread():
t1 = time()
count(N)
time_taken = time() - t1
return time_taken | def run_count_in_single_thread(): ...
def run_count_in_single_thread(): ...
def run_count_in_multiple_threads(): ...
| aktech/gil_talk | test_run_count_in_single_thread | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000005.py |
python_c_extension/c_extension_gil.py | null | run_count_in_multiple_threads | import unittest
class Test_run_count_in_multiple_threads(unittest.TestCase):
def test_run_count_in_multiple_threads(self):
time_taken = run_count_in_multiple_threads()
self.assertGreater(time_taken, 0)
| def run_count_in_multiple_threads():
t1 = time()
th1 = Thread(target=count, args=(N // 2,))
th2 = Thread(target=count, args=(N // 2,))
th1.start()
th2.start()
th1.join()
th2.join()
time_taken = time() - t1
return time_taken | def run_count_in_multiple_threads(): ...
def run_count_in_single_thread(): ...
def run_count_in_multiple_threads(): ...
| aktech/gil_talk | test_run_count_in_multiple_threads | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000006.py |
model.py | null | build_bar | import unittest
class Test_build_bar(unittest.TestCase):
def test_build_bar(self):
bar = model.build_bar(3, 0, 3, 0, 1, 2)
pixels = bar.get_pixels()
self.assertTrue(len(pixels) == 3)
self.assertTrue(pixels[0].get_color_channels() == (0, 1, 2), pixels[0].get_color_channels())
... | def build_bar(pixels, start_ch, step_offset, r_offset, g_offset, b_offset):
bar = Bar()
ch = start_ch
for off in range(0, pixels):
bar.add_pixel(Pixel(ch + r_offset, ch + g_offset, ch + b_offset))
ch += step_offset
return bar | def build_bar(pixels, start_ch, step_offset, r_offset, g_offset, b_offset): ...
def build_bar(pixels, start_ch, step_offset, r_offset, g_offset, b_offset): ...
| tuffnerdstuff/web-lights | test_build_bar | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | test_000007.py |
question.py | null | get_question | import unittest
class Test_get_question(unittest.TestCase):
def test_get_question(self):
question1 = Question.get_question()
self.assertIsInstance(question1, Question)
| def get_question(cls):
return Question('How many moons does Earth have?', 1.0)
| class Question():
@classmethod
def get_question(cls): ...
def __init__(self, prompt, answer): ...
self.prompt = prompt
self.answer = float(answer)
| kenzia/interval | test_get_question | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000008.py |
sureness.py | null | add_response | import unittest
class Test_add_response(unittest.TestCase):
def test_add_response_to_responses(self):
response1 = Response(4, 9, Question.get_question())
response2 = Response(1, 3, Question.get_question())
sureness1 = Sureness('real damn sure', [response1])
sureness1.add_response(re... | def add_response(self, response):
self.responses += [response]
| class Sureness():
def add_response(self, response): ...
def __init__(self, nickname, responses): ...
self.nickname = nickname
self.responses = responses
| kenzia/interval | test_add_response_to_responses | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000009.py |
pydare/dlyap.py | null | dlyap_iterative | import unittest
class Test_dlyap_iterative(unittest.TestCase):
def testIterative(self):
x = dlyap_iterative(self.a, self.q)
self.assertAlmostEqual(4.75, x[0, 0], 4)
self.assertAlmostEqual(4.1875, x[1, 1], 4)
for i in range(0, 2):
for j in range(0, 2):
if ... | def dlyap_iterative(a, q, eps=LYAPUNOV_EPSILON, iter_limit=ITER_LIMIT):
"""Solves the Discrete Lyapunov Equation (X = A X A' + Q) via an iterative
method. The routine returns an estimate of X based on the A and Q input
matrices.
This iterative solver requires that the eigenvalues of the square m... | def dlyap_iterative(a, q, eps=LYAPUNOV_EPSILON, iter_limit=ITER_LIMIT): ...
def dlyap_iterative(a, q, eps=LYAPUNOV_EPSILON, iter_limit=ITER_LIMIT): ...
def dlyap_schur(a, q): ...
def dlyap_slycot(a, q): ...
def dlyap(a, q, iterative=False, iteration_limit=ITER_LIMIT): ...
| LeonNie52/pydare | testIterative | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000010.py |
lis.py | null | lis | import unittest
class Test_lis(unittest.TestCase):
def test_lis(self):
for l, longest_s in zip(self.lists, self.list_lis):
self.assertEqual(longest_s, lis(l))
| def lis(sequence):
list_of_sequences = [[sequence[0]]]
for item in sequence:
if item > list_of_sequences[-1][-1]:
new_s = list(list_of_sequences[-1])
new_s.append(item)
list_of_sequences.append(new_s)
elif item < list_of_sequences[0][0]:
list_of_se... | def lis(sequence): ...
def generate_random_sequence(length=50): ...
def lis2(sequence): ...
def lis(sequence): ...
def clone_extend_remove(item, list_of_sequences): ...
def remove_lists_of_same_length(list1, list_of_lists): ...
| chuckha/LongestIncreasingSubsequence | test_lis | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000001.py |
lis.py | null | lis2 | import unittest
class Test_lis2(unittest.TestCase):
def test_lis2(self):
for l, longest_s in zip(self.lists, self.list_lis):
self.assertEqual(len(longest_s), lis2(l))
| def lis2(sequence):
lengths = []
for i, s in enumerate(sequence):
if i == 0:
lengths.append(1)
else:
possibles = []
for j, length in enumerate(lengths):
if s > sequence[j]:
possibles.append(length + 1)
else:
... | def lis2(sequence): ...
def generate_random_sequence(length=50): ...
def lis2(sequence): ...
def lis(sequence): ...
def clone_extend_remove(item, list_of_sequences): ...
def remove_lists_of_same_length(list1, list_of_lists): ...
| chuckha/LongestIncreasingSubsequence | test_lis2 | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000002.py |
equation.py | null | generate_numbers | import unittest
class Test_generate_numbers(unittest.TestCase):
def test_generate_number(self):
self.assertEqual(generate_numbers(self.num_array, [[8, 4, 1, 2]]), [8412])
| def generate_numbers(num_array, patterns):
return [int(''.join([str(num_array[i]) for i in pattern])) for pattern in patterns] | def generate_numbers(num_array, patterns): ...
def patterns(words): ...
def generate_numbers(num_array, patterns): ...
| chuckha/Cryptarithm | test_generate_number | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000003.py |
app/models.py | User | generate_confirmation_token | import unittest
class Test_User_generate_confirmation_token(unittest.TestCase):
def test_valid_confirmation_token(self):
user = User(password='password')
db.session.add(user)
db.session.commit()
token = user.generate_confirmation_token()
self.assertTrue(user.confirm(token))
... | def generate_confirmation_token(self, expiration=3600):
s = Serializer(current_app.config['SECRET_KEY'], expiration)
return s.dumps({'confirm': self.id}).decode('utf-8')
| class User(UserMixindb.Model):
def generate_confirmation_token(self, expiration=3600): ...
def to_json(self): ...
def __init__(self, **kwargs): ...
def add_self_follows(): ...
def gravatar_hash(self): ...
def ping(self): ...
def password(self): ...
def password(self, password): ...
d... | vshalt/chirp | test_valid_confirmation_token | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
1,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000004.py |
app/models.py | User | generate_reset_token | import unittest
class Test_User_generate_reset_token(unittest.TestCase):
def test_valid_reset_token(self):
user = User(password='password')
db.session.add(user)
db.session.commit()
token = user.generate_reset_token()
self.assertTrue(user.reset_password(token, 'new_password')... | def generate_reset_token(self, expiration=3600):
s = Serializer(current_app.config['SECRET_KEY'], expires_in=expiration)
return s.dumps({'reset': self.id}).decode('utf-8')
| class User(UserMixindb.Model):
def generate_reset_token(self, expiration=3600): ...
def to_json(self): ...
def __init__(self, **kwargs): ...
def add_self_follows(): ...
def gravatar_hash(self): ...
def ping(self): ...
def password(self): ...
def password(self, password): ...
def veri... | vshalt/chirp | test_valid_reset_token | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
1,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000005.py |
app/models.py | User | generate_email_update_token | import unittest
class Test_User_generate_email_update_token(unittest.TestCase):
def test_valid_email_change_token(self):
user = User(password='password')
db.session.add(user)
db.session.commit()
token = user.generate_email_update_token('example@mail.com')
self.assertTrue(use... | def generate_email_update_token(self, new_email, expiration=3600):
s = Serializer(current_app.config['SECRET_KEY'], expires_in=expiration)
return s.dumps({'update_email': self.id, 'new_email': new_email}).decode('utf-8')
| class User(UserMixindb.Model):
def generate_email_update_token(self, new_email, expiration=3600): ...
def to_json(self): ...
def __init__(self, **kwargs): ...
def add_self_follows(): ...
def gravatar_hash(self): ...
def ping(self): ...
def password(self): ...
def password(self, password)... | vshalt/chirp | test_valid_email_change_token | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
1,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | test_000006.py |
app/models.py | User | update_email | import unittest
class Test_User_update_email(unittest.TestCase):
def test_duplicate_email(self):
user = User(email='sername@mail.com', password='password')
user1 = User(email='ail@mail.com', password='password1')
db.session.add(user)
db.session.add(user1)
db.session.commit()... | def update_email(self, token):
s = Serializer(current_app.config['SECRET_KEY'])
try:
data = s.loads(token.encode('utf-8'))
except:
return False
if data.get('update_email') != self.id:
return False
new_email = data.get('new_email')
i... | class User(UserMixindb.Model):
def update_email(self, token): ...
def to_json(self): ...
def __init__(self, **kwargs): ...
def add_self_follows(): ...
def gravatar_hash(self): ...
def ping(self): ...
def password(self): ...
def password(self, password): ...
def verify_password(self, ... | vshalt/chirp | test_duplicate_email | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
1,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | test_000007.py |
app/models.py | User | ping | import unittest
class Test_User_ping(unittest.TestCase):
def test_ping(self):
user = User(password='password')
db.session.add(user)
db.session.commit()
last_seen_before = user.last_seen
user.ping()
self.assertTrue(user.last_seen > last_seen_before)
| def ping(self):
self.last_seen = datetime.utcnow()
db.session.add(self)
db.session.commit()
| class User(UserMixindb.Model):
def ping(self): ...
def to_json(self): ...
def __init__(self, **kwargs): ...
def add_self_follows(): ...
def gravatar_hash(self): ...
def password(self): ...
def password(self, password): ...
def verify_password(self, password): ...
def generate_confirm... | vshalt/chirp | test_ping | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
1,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | test_000008.py |
app/models.py | User | gravatar | import unittest
class Test_User_gravatar(unittest.TestCase):
def test_gravatar(self):
user = User(email='john@example.com', password='catdog')
with self.app.test_request_context('/'):
gravatar = user.gravatar()
gravatar_256 = user.gravatar(size=256)
gravatar_pg =... | def gravatar(self, size=100, default='identicon', rating='g'):
if request.is_secure:
url = 'https://secure.gravatar.com/avatar'
else:
url = 'https://www.gravatar.com/avatar'
hash = self.avatar_hash or self.gravatar_hash()
return f'{url}/{hash}?s={size}&d={defa... | class User(UserMixindb.Model):
def gravatar(self, size=100, default='identicon', rating='g'): ...
def to_json(self): ...
def __init__(self, **kwargs): ...
def add_self_follows(): ...
def gravatar_hash(self): ...
def ping(self): ...
def password(self): ...
def password(self, password): ..... | vshalt/chirp | test_gravatar | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
1,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | test_000009.py |
app/models.py | User | is_following | import unittest
class Test_User_is_following(unittest.TestCase):
def test_follows(self):
user1 = User(email='john@example.com', password='cat')
user2 = User(email='susan@example.org', password='dog')
db.session.add(user1)
db.session.add(user2)
db.session.commit()
sel... | def is_following(self, user):
if user.id is None:
return False
else:
return self.followed.filter_by(followed_id=user.id).first() is not None
| class User(UserMixindb.Model):
def is_following(self, user): ...
def to_json(self): ...
def __init__(self, **kwargs): ...
def add_self_follows(): ...
def gravatar_hash(self): ...
def ping(self): ...
def password(self): ...
def password(self, password): ...
def verify_password(self, p... | vshalt/chirp | test_follows | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
1,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | test_000010.py |
app/models.py | User | to_json | import unittest
class Test_User_to_json(unittest.TestCase):
def test_to_json(self):
user = User(email='john@example.com', password='cat')
db.session.add(user)
db.session.commit()
with self.app.test_request_context('/'):
json_user = user.to_json()
expected_keys = ... | def to_json(self):
user_json = {'user_url': url_for('api.get_user', id=self.id), 'username': self.username, 'member_since': self.member_since, 'last_seen': self.last_seen, 'posts': url_for('api.get_user_posts', id=self.id), 'followed_posts': url_for('api.get_user_followed_posts', id=self.id), 'posts_count':... | class User(UserMixindb.Model):
def to_json(self): ...
def __init__(self, **kwargs): ...
def add_self_follows(): ...
def gravatar_hash(self): ...
def ping(self): ...
def password(self): ...
def password(self, password): ...
def verify_password(self, password): ...
def generate_confirm... | vshalt/chirp | test_to_json | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
1,
1,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000011.py |
client/stt.py | null | transcribe | import unittest
class Test_transcribe(unittest.TestCase):
def testTranscribe(self):
"""
Does Jasper recognize 'time' (i.e., active listen)?
"""
with open(self.time_clip, mode='rb') as f:
transcription = self.active_stt_engine.transcribe(f)
self.assertIn('... | def transcribe(self, fp):
pass
| class AbstractSTTEngine(object):
@abstractmethod
def transcribe(self, fp): ...
def get_config(cls): ...
def get_instance(cls, vocabulary_name, phrases): ...
def get_passive_instance(cls): ...
def get_active_instance(cls): ...
def is_available(cls): ...
__metaclass__ = ABCMeta
VOCABU... | High-Tech-Team/Jasper | testTranscribe | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000012.py |
client/g2p.py | null | translate | import unittest
class Test_translate(unittest.TestCase):
def testTranslateWord(self):
with mock.patch('subprocess.Popen', return_value=TestPatchedG2P.DummyProc()):
for word in WORDS:
self.assertIn(word, self.g2pconv.translate(word).keys())
| def translate(self, words):
if type(words) is str or len(words) == 1:
self._logger.debug('Converting single word to phonemes')
output = self._translate_word(words if type(words) is str else words[0])
else:
self._logger.debug('Converting %d words to phonemes', len(... | class PhonetisaurusG2P(object):
def translate(self, words): ...
def execute(cls, fst_model, input, is_file=False, nbest=None): ...
def get_config(cls): ...
def __new__(cls, fst_model=None, *args, **kwargs): ...
def __init__(self, fst_model=None, nbest=None): ...
def _translate_word(self, word): ... | High-Tech-Team/Jasper | testTranslateWord | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000013.py |
scripts/MyXBee/frame.py | null | remaining_bytes | import unittest
class Test_remaining_bytes(unittest.TestCase):
def test_remaining_bytes(self):
"""
remaining_bytes() should provide accurate indication
of remaining bytes required before parsing a packet
"""
api_frame = APIFrame()
frame = b'~\x00\x04\x00\... | def remaining_bytes(self):
remaining = 3
if len(self.raw_data) >= 3:
raw_len = self.raw_data[1:3]
data_len = struct.unpack('> h', raw_len)[0]
remaining += data_len
remaining += 1
return remaining - len(self.raw_data)
| class APIFrame():
def remaining_bytes(self): ...
def __init__(self, data=b'', escaped=False): ...
def checksum(self): ...
def verify(self, chksum): ...
def len_bytes(self): ...
def output(self): ...
def escape(data): ...
def fill(self, byte): ...
def parse(self): ...
self.data =... | dengshuan/sunist | test_remaining_bytes | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000014.py |
scripts/MyXBee/base.py | null | _write | import unittest
class Test_write(unittest.TestCase):
def test_write(self):
"""
_write method should write the expected data to the serial
device
"""
device = FakeDevice()
xbee = XBeeBase(device)
xbee._write(b'\x00')
expected_frame = b'~\x0... | def _write(self, data):
"""
_write: binary data -> None
Packages the given binary data in an API frame and writes the
result to the serial port
"""
frame = APIFrame(data, self._escaped).output()
self.serial.write(frame)
| class XBeeBase(threading.Thread):
def _write(self, data): ...
def __init__(self, ser, shorthand=True, callback=None, escaped=False): ...
def halt(self): ...
def run(self): ...
def _wait_for_frame(self): ...
def _build_command(self, cmd, **kwargs): ...
def _split_response(self, data): ...
... | dengshuan/sunist | test_write | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000015.py |
ITR/temperature_score.py | TemperatureScore | calculate | import unittest
class Test_TemperatureScore_calculate(unittest.TestCase):
def test_score_cap(self):
companies, targets, pf_companies = self.create_base_companies(['A'])
data_provider = TestDataProvider(companies=companies, targets=targets)
temp_score = TemperatureScore(time_frames=[ETimeFra... | def calculate(self, data: Optional[pd.DataFrame]=None, data_providers: Optional[List[data.DataProvider]]=None, portfolio: Optional[List[PortfolioCompany]]=None):
"""
Calculate the temperature for a dataframe of company data. The columns in the data frame should be a combination
of ID... | class TemperatureScore(PortfolioAggregation):
def calculate(self, data: Optional[pd.DataFrame]=None, data_providers: Optional[List[data.DataProvider]]=None, portfolio: Optional[List[PortfolioCompany]]=None): ...
def __init__(self, time_frames: List[ETimeFrames], scopes: List[EScope], fallback_score: float=3.2, ... | os-c/ITR | test_score_cap | [
1,
1,
0,
0,
0,
1,
0,
1,
0,
0,
1,
1,
0,
0,
0,
0,
1,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | test_000016.py |
ITR/interfaces.py | null | validate_e | import unittest
class Test_validate_e(unittest.TestCase):
def test_IDataProviderTarget(self):
self.assertEqual(IDataProviderTarget.validate_e('test'), 'test')
self.assertIsNone(IDataProviderTarget.validate_e(''))
self.assertIsNone(IDataProviderTarget.validate_e('nan'))
| def validate_e(cls, val):
if val == '' or val == 'nan' or pd.isnull(val):
return None
return val
| class IDataProviderTarget(BaseModel):
@validator('start_year', pre=True, always=False)
def validate_e(cls, val): ... | os-c/ITR | test_IDataProviderTarget | [
1,
1,
0,
0,
0,
1,
0,
1,
0,
0,
1,
1,
0,
0,
0,
0,
1,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000017.py |
ITR/portfolio_aggregation.py | null | is_emissions_based | import unittest
class Test_is_emissions_based(unittest.TestCase):
def test_is_emissions_based(self):
self.assertTrue(PortfolioAggregationMethod.is_emissions_based(PortfolioAggregationMethod.MOTS))
self.assertTrue(PortfolioAggregationMethod.is_emissions_based(PortfolioAggregationMethod.EOTS))
... | def is_emissions_based(method: 'PortfolioAggregationMethod') -> bool:
"""
Check whether a given method is emissions-based (i.e. it uses the emissions to calculate the aggregation).
:param method: The method to check
:return:
"""
return method == P... | class PortfolioAggregationMethod(Enum):
@staticmethod
def is_emissions_based(method: 'PortfolioAggregationMethod') -> bool: ...
def get_value_column(method: 'PortfolioAggregationMethod', column_config: Type[ColumnsConfig]) -> str: ...
WATS = 'WATS'
TETS = 'TETS'
MOTS = 'MOTS'
EOTS = 'EOTS'
... | os-c/ITR | test_is_emissions_based | [
1,
1,
0,
0,
0,
1,
0,
1,
0,
0,
1,
1,
0,
0,
0,
0,
1,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000018.py |
ITR/portfolio_aggregation.py | null | get_value_column | import unittest
class Test_get_value_column(unittest.TestCase):
def test_get_value_column(self):
self.assertEqual(PortfolioAggregationMethod.get_value_column(PortfolioAggregationMethod.MOTS, ColumnsConfig), ColumnsConfig.MARKET_CAP)
self.assertEqual(PortfolioAggregationMethod.get_value_column(Portf... | def get_value_column(method: 'PortfolioAggregationMethod', column_config: Type[ColumnsConfig]) -> str:
map_value_column = {PortfolioAggregationMethod.MOTS: column_config.MARKET_CAP, PortfolioAggregationMethod.EOTS: column_config.COMPANY_ENTERPRISE_VALUE, PortfolioAggregationMethod.ECOTS: column_config.COMPA... | class PortfolioAggregationMethod(Enum):
@staticmethod
def get_value_column(method: 'PortfolioAggregationMethod', column_config: Type[ColumnsConfig]) -> str: ...
def is_emissions_based(method: 'PortfolioAggregationMethod') -> bool: ...
WATS = 'WATS'
TETS = 'TETS'
MOTS = 'MOTS'
EOTS = 'EOTS'
... | os-c/ITR | test_get_value_column | [
1,
1,
0,
0,
0,
1,
0,
1,
0,
0,
1,
1,
0,
0,
0,
0,
1,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000019.py |
ITR/portfolio_aggregation.py | PortfolioAggregation | _check_column | import unittest
class Test_PortfolioAggregation_check_column(unittest.TestCase):
def test_check_column(self):
PortfolioAggregation()._check_column(data=self.data, column=ColumnsConfig.COMPANY_REVENUE)
self.data.loc[0, ColumnsConfig.MARKET_CAP] = pd.NA
with self.assertRaises(ValueError):
... | def _check_column(self, data: pd.DataFrame, column: str):
"""
Check if a certain column is filled for all companies. If not throw an error.
:param data: The data to check
:param column: The column to check
:return:
"""
missing_data = d... | class PortfolioAggregation(ABC):
def _check_column(self, data: pd.DataFrame, column: str): ...
def __init__(self, config: Type[PortfolioAggregationConfig]=PortfolioAggregationConfig): ...
def _calculate_aggregate_score(self, data: pd.DataFrame, input_column: str, portfolio_aggregation_method: PortfolioAggre... | os-c/ITR | test_check_column | [
1,
1,
0,
0,
0,
1,
0,
1,
0,
0,
1,
1,
0,
0,
0,
0,
1,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000020.py |
ITR/portfolio_aggregation.py | PortfolioAggregation | _calculate_aggregate_score | import unittest
class Test_PortfolioAggregation_calculate_aggregate_score(unittest.TestCase):
def test_calculate_aggregate_score_WATS(self):
pd.testing.assert_series_equal(PortfolioAggregation()._calculate_aggregate_score(data=self.data, input_column=ColumnsConfig.MARKET_CAP, portfolio_aggregation_method=P... | def _calculate_aggregate_score(self, data: pd.DataFrame, input_column: str, portfolio_aggregation_method: PortfolioAggregationMethod) -> pd.Series:
"""
Aggregate the scores in a given column based on a certain portfolio aggregation method.
:param data: The data to run the calcul... | class PortfolioAggregation(ABC):
def _calculate_aggregate_score(self, data: pd.DataFrame, input_column: str, portfolio_aggregation_method: PortfolioAggregationMethod) -> pd.Series: ...
def __init__(self, config: Type[PortfolioAggregationConfig]=PortfolioAggregationConfig): ...
def _check_column(self, data: ... | os-c/ITR | test_calculate_aggregate_score_WATS | [
1,
1,
0,
0,
0,
1,
0,
1,
0,
0,
1,
1,
0,
0,
0,
0,
1,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000021.py |
_abathur/extract.py | Extractor | perform_extraction | import unittest
class Test_Extractor_perform_extraction(unittest.TestCase):
def test_extractor_query_param(self):
"""
Testing the Extractor with query_param = True
"""
tmp_dir = self.__class__.TMP_DIR
db_name = self.__class__.DB_NAME
db_conn_str = 'sqlite:///... | def perform_extraction(self):
"""
query_param: whether we should query the params or just use the file as
params
"""
engine = create_engine(self._db_connection_string)
conn = engine.connect()
param_keys = []
param_list = []
if self.... | class Extractor(object):
def perform_extraction(self): ...
def __init__(self, db_connection_string, param_file, query_file, output_file, query_param): ...
self._db_connection_string = db_connection_string
self._param_file = param_file
self._query_file = query_file
self._output_file = output_fil... | realstraw/abathur | test_extractor_query_param | [
1,
0,
0,
0,
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000022.py |
ratr0/util/png_util.py | null | chunks | import unittest
class Test_chunks(unittest.TestCase):
def test_chunks(self):
"""test the chunks() function"""
self.assertEquals([[1], [2], [3]], list(png_util.chunks([1, 2, 3], 1)))
self.assertEquals([[1, 2], [3, 4]], list(png_util.chunks([1, 2, 3, 4], 2)))
| def chunks(l, n):
for i in range(0, len(list(l)), n):
yield l[i:i + n] | def chunks(l, n): ...
def chunks(l, n): ...
def color_to_plane_bits(color, depth): ...
def extract_planes(im, depth, verbose): ...
def interleave_planes(planes, map_words_per_row): ...
def make_colors(im, final_depth, verbose): ...
| weiju/ratr0-utils | test_chunks | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000023.py |
ratr0/util/png_util.py | null | color_to_plane_bits | import unittest
class Test_color_to_plane_bits(unittest.TestCase):
def test_color_to_plane_bits_depth_0(self):
"""call color_to_plane_bits() with depth 0"""
self.assertEquals([], png_util.color_to_plane_bits(0, 0))
def test_color_to_plane_bits_depth_1(self):
"""call color_to_plane_bits... | def color_to_plane_bits(color, depth):
"""returns the bits for a given pixel in a list, lowest to highest plane"""
result = [0] * depth
for bit in range(depth):
if color & 1 << bit != 0:
result[bit] = 1
return result | def color_to_plane_bits(color, depth): ...
def chunks(l, n): ...
def color_to_plane_bits(color, depth): ...
def extract_planes(im, depth, verbose): ...
def interleave_planes(planes, map_words_per_row): ...
def make_colors(im, final_depth, verbose): ...
| weiju/ratr0-utils | test_color_to_plane_bits_depth_0 | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000024.py |
ratr0/util/png_util.py | null | extract_planes | import unittest
class Test_extract_planes(unittest.TestCase):
def test_extract_planes_0(self):
"""attempting to extract from an image with depth 0"""
im = MockImage((2, 2), [1, 0, 0, 1])
planes, map_words_per_row = png_util.extract_planes(im, 0, False)
self.assertEquals([], planes)
... | def extract_planes(im, depth, verbose):
"""check extract_planes(), seems to be wrong and lose data !!!"""
imdata = im.getdata()
width, height = im.size
map_words_per_row = int(width / 16)
if width % 16 > 0:
map_words_per_row += 1
if verbose:
print('source image width: %d height: ... | def extract_planes(im, depth, verbose): ...
def chunks(l, n): ...
def color_to_plane_bits(color, depth): ...
def extract_planes(im, depth, verbose): ...
def interleave_planes(planes, map_words_per_row): ...
def make_colors(im, final_depth, verbose): ...
| weiju/ratr0-utils | test_extract_planes_0 | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000025.py |
data_structures/radix_sort.py | null | radix_sort | import unittest
class Test_radix_sort(unittest.TestCase):
def test_sort(self):
input_li = [65, 43, 21, 10, 32, 54]
expected = [10, 21, 32, 43, 54, 65]
self.assertEquals(radix_sort(input_li, 10), expected)
| def radix_sort(unsorted, base):
result = unsorted
if not result:
return []
length = int(floor(log(abs(max(unsorted)), base))) + 1
mini = int(floor(log(abs(min(unsorted)), base))) + 1
if mini > length:
length = mini
for i in xrange(1, length + 1):
buckets = [[] for x in ra... | def radix_sort(unsorted, base): ...
def radix_sort(unsorted, base): ...
| sbabineau/data-structures | test_sort | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000026.py |
data_structures/quick_sort.py | null | quick_sort | import unittest
class Test_quick_sort(unittest.TestCase):
def test_sort(self):
input_li = [6, 4, 2, 1, 3, 5]
expected = [1, 2, 3, 4, 5, 6]
self.assertEquals(quick_sort(input_li), expected)
| def quick_sort(unsorted, method='median'):
if len(unsorted) < 2:
return unsorted
piv = pivot(unsorted, method=method)
lesser = [i for i in unsorted if i < piv]
greater = [i for i in unsorted if i > piv]
piv_list = [i for i in unsorted if i == piv]
lesser = quick_sort(lesser, method=metho... | def quick_sort(unsorted, method='median'): ...
def quick_sort(unsorted, method='median'): ...
def pivot(list_inp, method='median'): ...
| sbabineau/data-structures | test_sort | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000027.py |
data_structures/quick_sort.py | null | pivot | import unittest
class Test_pivot(unittest.TestCase):
def test_front_pivot(self):
self.assertEquals(pivot(self.inp, method='first'), 6)
def test_last_pivot(self):
self.assertEquals(pivot(self.inp, method='last'), 5)
def test_median_pivot(self):
self.assertEquals(pivot(self.inp, met... | def pivot(list_inp, method='median'):
"""Defines a pivot point for quicksort, method can be ['first', 'last',
'median']"""
if method.lower() == 'median':
med_list = [list_inp[0], list_inp[-1], list_inp[len(list_inp) // 2]]
med_list.remove(max(med_list))
med_list.remove(min(med_list))... | def pivot(list_inp, method='median'): ...
def quick_sort(unsorted, method='median'): ...
def pivot(list_inp, method='median'): ...
| sbabineau/data-structures | test_front_pivot | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000028.py |
data_structures/queue.py | null | dequeue | import unittest
class Test_dequeue(unittest.TestCase):
def test_dequeue(self):
self.assertEqual(self.qtest.dequeue(), True)
def test_dequeue_head(self):
self.qtest.dequeue()
self.assertEqual(self.qtest.head.value, 6)
def test_dequeue_empty(self):
self.qtest.dequeue()
... | def dequeue(self):
if self.head is self.tail:
self.tail = None
if self.head:
response, self.head = (self.head.value, self.head.next)
self.length -= 1
return response
else:
raise IndexError
| class Queue(object):
def dequeue(self): ...
def __init__(self): ...
def enqueue(self, value): ...
def length(self): ...
self.head = None
self.tail = None
self.length = 0
| sbabineau/data-structures | test_dequeue | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0
] | test_000029.py |
data_structures/binarytree.py | null | insert | import unittest
class Test_insert(unittest.TestCase):
def test_insert(self):
self.tree.insert(9)
self.assertTrue(self.tree.contains(9))
def test_reinsert(self):
self.tree.insert(7)
self.assertEqual(self.tree.size(), 1)
| def insert(self, value):
"""Insert an integer into a binary tree"""
if value == self.value:
return
elif value > self.value:
if self.greater is None:
self.greater = BinaryTree(value)
return
self.greater.insert(value)
... | class BinaryTree(object):
def insert(self, value): ...
def __init__(self, value=None): ...
def contains(self, value): ...
def size(self, total=0): ...
def depth(self): ...
def balance(self): ...
def in_order(self): ...
def pre_order(self): ...
def post_order(self): ...
def breadt... | sbabineau/data-structures | test_insert | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000030.py |
data_structures/binarytree.py | null | contains | import unittest
class Test_contains(unittest.TestCase):
def test_contains_false(self):
self.assertFalse(self.tree.contains(6))
| def contains(self, value):
"""Determine whether value is contained in binary tree"""
try:
if value == self.value:
return True
elif value > self.value:
return self.greater.contains(value)
elif value < self.value:
retu... | class BinaryTree(object):
def contains(self, value): ...
def __init__(self, value=None): ...
def insert(self, value): ...
def size(self, total=0): ...
def depth(self): ...
def balance(self): ...
def in_order(self): ...
def pre_order(self): ...
def post_order(self): ...
def breadt... | sbabineau/data-structures | test_contains_false | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000031.py |
data_structures/binarytree.py | null | size | import unittest
class Test_size(unittest.TestCase):
def test_size(self):
self.assertEqual(self.tree.size(), 1)
self.tree.insert(6)
self.assertEqual(self.tree.size(), 2)
def test_empty_size(self):
self.assertEqual(self.tree.size(), 0)
| def size(self, total=0):
"""Returns total of all values within binary tree"""
if self.value:
total += 1
else:
return 0
if self.lesser:
total += self.lesser.size()
if self.greater:
total += self.lesser.size()
return total... | class BinaryTree(object):
def size(self, total=0): ...
def __init__(self, value=None): ...
def insert(self, value): ...
def contains(self, value): ...
def depth(self): ...
def balance(self): ...
def in_order(self): ...
def pre_order(self): ...
def post_order(self): ...
def breadt... | sbabineau/data-structures | test_size | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000032.py |
data_structures/binarytree.py | null | depth | import unittest
class Test_depth(unittest.TestCase):
def test_depth(self):
self.tree.insert(8)
self.tree.insert(9)
self.tree.insert(10)
self.tree.insert(5)
self.assertEqual(self.tree.depth(), 4)
| def depth(self):
if self.value is None:
return 0
a = self.greater.depth() if self.greater else 0
b = self.lesser.depth() if self.lesser else 0
return max(a, b) + 1
| class BinaryTree(object):
def depth(self): ...
def __init__(self, value=None): ...
def insert(self, value): ...
def contains(self, value): ...
def size(self, total=0): ...
def balance(self): ...
def in_order(self): ...
def pre_order(self): ...
def post_order(self): ...
def breadt... | sbabineau/data-structures | test_depth | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000033.py |
data_structures/binarytree.py | null | balance | import unittest
class Test_balance(unittest.TestCase):
def test_balance_pos(self):
self.tree.insert(10)
self.tree.insert(8)
self.tree.insert(9)
self.assertEqual(self.tree.balance(), 3)
def test_balance_neg(self):
self.tree.insert(1)
self.tree.insert(2)
s... | def balance(self):
a = self.greater.depth() if self.greater else 0
b = self.lesser.depth() if self.lesser else 0
return a - b
| class BinaryTree(object):
def balance(self): ...
def __init__(self, value=None): ...
def insert(self, value): ...
def contains(self, value): ...
def size(self, total=0): ...
def depth(self): ...
def in_order(self): ...
def pre_order(self): ...
def post_order(self): ...
def breadt... | sbabineau/data-structures | test_balance_pos | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000034.py |
data_structures/binarytree.py | null | in_order | import unittest
class Test_in_order(unittest.TestCase):
def test_in_order(self):
outp = []
for i in self.tree.in_order():
outp.append(i)
self.assertEqual(outp, [4, 5, 6, 10, 14, 15, 16])
| def in_order(self):
if self.lesser is not None:
for i in self.lesser.in_order():
yield i
if self.value is not None:
yield self.value
if self.greater is not None:
for i in self.greater.in_order():
yield i
| class BinaryTree(object):
def in_order(self): ...
def __init__(self, value=None): ...
def insert(self, value): ...
def contains(self, value): ...
def size(self, total=0): ...
def depth(self): ...
def balance(self): ...
def pre_order(self): ...
def post_order(self): ...
def breadt... | sbabineau/data-structures | test_in_order | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000035.py |
data_structures/binarytree.py | null | post_order | import unittest
class Test_post_order(unittest.TestCase):
def test_post_order(self):
outp = []
for i in self.tree.post_order():
outp.append(i)
self.assertEqual(outp, [4, 6, 5, 14, 16, 15, 10])
| def post_order(self):
if self.lesser is not None:
for i in self.lesser.pre_order():
yield i
if self.greater is not None:
for i in self.greater.pre_order():
yield i
if self.value is not None:
yield self.value
| class BinaryTree(object):
def post_order(self): ...
def __init__(self, value=None): ...
def insert(self, value): ...
def contains(self, value): ...
def size(self, total=0): ...
def depth(self): ...
def balance(self): ...
def in_order(self): ...
def pre_order(self): ...
def breadt... | sbabineau/data-structures | test_post_order | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000036.py |
data_structures/binarytree.py | null | pre_order | import unittest
class Test_pre_order(unittest.TestCase):
def test_pre_order(self):
outp = []
for i in self.tree.pre_order():
outp.append(i)
self.assertEqual(outp, [10, 5, 4, 6, 15, 14, 16])
| def pre_order(self):
if self.value is not None:
yield self.value
if self.lesser is not None:
for i in self.lesser.post_order():
yield i
if self.greater is not None:
for i in self.greater.post_order():
yield i
| class BinaryTree(object):
def pre_order(self): ...
def __init__(self, value=None): ...
def insert(self, value): ...
def contains(self, value): ...
def size(self, total=0): ...
def depth(self): ...
def balance(self): ...
def in_order(self): ...
def post_order(self): ...
def breadt... | sbabineau/data-structures | test_pre_order | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000037.py |
data_structures/binarytree.py | null | breadth_first | import unittest
class Test_breadth_first(unittest.TestCase):
def test_breadth_first(self):
outp = []
for i in self.tree.breadth_first():
outp.append(i)
self.assertEqual(outp, [10, 5, 15, 4, 6, 14, 16])
| def breadth_first(self):
inp = deque()
inp.append(self)
while len(inp) > 0:
outp = inp.popleft()
yield outp.value
if outp.lesser is not None:
inp.append(outp.lesser)
if outp.greater is not None:
inp.append(outp.g... | class BinaryTree(object):
def breadth_first(self): ...
def __init__(self, value=None): ...
def insert(self, value): ...
def contains(self, value): ...
def size(self, total=0): ...
def depth(self): ...
def balance(self): ...
def in_order(self): ...
def pre_order(self): ...
def pos... | sbabineau/data-structures | test_breadth_first | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000038.py |
docker_dns_test.py | null | check_record | import unittest
class Test_check_record(unittest.TestCase):
def test__a_records_id(self):
rec = self.resolver._a_records('cidpandas.docker')
self.assertEqual(len(rec), 1)
rec = rec[0]
self.assertTrue(check_record(rec, name='cidpandas.docker', type=dns.A))
self.assertEqual(re... | def check_record(record, **kwargs):
for k in kwargs:
real_value = getattr(record, k)
if k is 'name':
real_value = real_value.name
if real_value != kwargs[k]:
return False
return True | def check_record(record, **kwargs): ...
def in_generator(gen, val): ...
def check_record(record, **kwargs): ...
def check_deferred(deferred, success): ...
def main(): ...
| infoxchange/docker_dns | test__a_records_id | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000039.py |
forklift/arguments.py | null | convert_to_args | import unittest
class Test_convert_to_args(unittest.TestCase):
def test_convert_to_args(self):
"""
Test convert_to_args.
"""
conf = OrderedDict([('simple', 'value'), ('number', 10), ('array', ['one', 'two']), ('empty_array', []), ('nested', OrderedDict([('first', 'deep'), ('... | def convert_to_args(conf, prefix=None):
"""
Convert hierarchical configuration dictionary to argparse arguments.
'environment' at root level is a special case: if it is a hash,
it is converted into an array of VAR=VALUE pairs.
"""
args = []
conf = conf or {}
prefix = prefix or ()
if... | def convert_to_args(conf, prefix=None): ...
def argument_factory(add_argument, name): ...
def convert_to_args(conf, prefix=None): ...
def project_args(args, prefix): ...
| infoxchange/docker-forklift | test_convert_to_args | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000040.py |
forklift/arguments.py | null | project_args | import unittest
class Test_project_args(unittest.TestCase):
def test_project_args(self):
"""
Test project_args.
"""
args = Namespace(**{'one.a': '1a', 'one.b': '1b', 'two.c': '2c'})
self.assertEqual(vars(project_args(args, 'one')), {'a': '1a', 'b': '1b'})
| def project_args(args, prefix):
"""
Return only keys in the object having the specified prefix, stripping
the prefix.
"""
pairs = vars(args).items()
strip_len = len(prefix) + 1
return Namespace(**dict(((key[strip_len:], value) for key, value in pairs if key.startswith(prefix + '.')))) | def project_args(args, prefix): ...
def argument_factory(add_argument, name): ...
def convert_to_args(conf, prefix=None): ...
def project_args(args, prefix): ...
| infoxchange/docker-forklift | test_project_args | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000041.py |
editparser/__init__.py | TimeCode | attributes | import unittest
class Test_TimeCode_attributes(unittest.TestCase):
def test_creation_with_attributes(self):
mi = TimeCode('00:00:00:01')
mo = TimeCode('00:00:00:03')
gi = TimeCode('00:00:01:01')
go = TimeCode('00:00:02:01')
e = Edit(mi, mo, gi, go, name='stuff', number=1, bl... | def attributes(self):
return self._attributes
| class Edit():
def attributes(self): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def mediaOut(self): ...
def globalIn(self, refTC=None): ...
def globalOut(self, refTC=None): ...
def mediaInOut(self)... | svenni/editparser | test_creation_with_attributes | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000042.py |
editparser/__init__.py | null | mediaIn | import unittest
class Test_mediaIn(unittest.TestCase):
def test_get_media_in(self):
self.assertEquals(self.e.mediaIn(), self.mi)
| def mediaIn(self):
return self._mediaIn
| class Edit():
def mediaIn(self): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaOut(self): ...
def globalIn(self, refTC=None): ...
def globalOut(self, refTC=None): ...
def mediaInOut(self): ...
def globalInOut(self... | svenni/editparser | test_get_media_in | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000043.py |
editparser/__init__.py | null | mediaOut | import unittest
class Test_mediaOut(unittest.TestCase):
def test_get_media_out(self):
self.assertEquals(self.e.mediaOut(), self.mo)
| def mediaOut(self):
return self._mediaOut
| class Edit():
def mediaOut(self): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def globalIn(self, refTC=None): ...
def globalOut(self, refTC=None): ...
def mediaInOut(self): ...
def globalInOut(self... | svenni/editparser | test_get_media_out | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000044.py |
editparser/__init__.py | null | globalIn | import unittest
class Test_globalIn(unittest.TestCase):
def test_get_global_in(self):
self.assertEquals(self.e.globalIn(), self.gi)
| def globalIn(self, refTC=None):
if refTC is None:
refTC = TimeCode(frames=0, base=self._globalIn.base())
return self._globalIn - refTC
| class Edit():
def globalIn(self, refTC=None): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def mediaOut(self): ...
def globalOut(self, refTC=None): ...
def mediaInOut(self): ...
def globalInOut(self... | svenni/editparser | test_get_global_in | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000045.py |
editparser/__init__.py | null | globalOut | import unittest
class Test_globalOut(unittest.TestCase):
def test_get_global_out(self):
self.assertEquals(self.e.globalOut(), self.go)
| def globalOut(self, refTC=None):
if refTC is None:
refTC = TimeCode(frames=0, base=self._globalOut.base())
return self._globalOut - refTC
| class Edit():
def globalOut(self, refTC=None): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def mediaOut(self): ...
def globalIn(self, refTC=None): ...
def mediaInOut(self): ...
def globalInOut(self... | svenni/editparser | test_get_global_out | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000046.py |
editparser/__init__.py | TimeCode | frames | import unittest
class Test_TimeCode_frames(unittest.TestCase):
def test_get_global_out_with_ref_tc(self):
ref_tc = TimeCode('00:00:02:00')
self.assertEquals(self.e.globalOut(ref_tc).frames(), 1)
| def frames(self):
return self._frames
| class TimeCode():
def frames(self): ...
def __init__(self, tc='00:00:00:00', frames=0, base=24): ...
def from_msec(self, msec, base=24): ...
def base(self): ...
def tc(self): ...
def toFrames(self, tc): ...
def __str__(self): ...
def __repr__(self): ...
def __add__(self, other): ...
... | svenni/editparser | test_get_global_out_with_ref_tc | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000047.py |
editparser/__init__.py | null | mediaInOut | import unittest
class Test_mediaInOut(unittest.TestCase):
def test_get_mediaInOut(self):
self.assertEquals(self.e.mediaInOut(), (self.mi, self.mo))
| def mediaInOut(self):
return (self._mediaIn, self._mediaOut)
| class Edit():
def mediaInOut(self): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def mediaOut(self): ...
def globalIn(self, refTC=None): ...
def globalOut(self, refTC=None): ...
def globalInOut(self... | svenni/editparser | test_get_mediaInOut | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000048.py |
editparser/__init__.py | null | globalInOut | import unittest
class Test_globalInOut(unittest.TestCase):
def test_get_globalInOut(self):
self.assertEquals(self.e.globalInOut(), (self.gi, self.go))
| def globalInOut(self, refTC=None):
if refTC is None:
refTC = TimeCode(frames=0, base=self._globalIn.base())
return (self.globalIn(refTC), self.globalOut(refTC))
| class Edit():
def globalInOut(self, refTC=None): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def mediaOut(self): ...
def globalIn(self, refTC=None): ...
def globalOut(self, refTC=None): ...
def med... | svenni/editparser | test_get_globalInOut | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000049.py |
editparser/__init__.py | TimeCode | globalInOut | import unittest
class Test_TimeCode_globalInOut(unittest.TestCase):
def test_get_globalInOut_with_ref_tc(self):
ref_tc = TimeCode('00:00:02:00')
g_in, g_out = self.e.globalInOut(ref_tc)
self.assertEquals(g_in.frames(), -23)
self.assertEquals(g_out.frames(), 1)
| def globalInOut(self, refTC=None):
if refTC is None:
refTC = TimeCode(frames=0, base=self._globalIn.base())
return (self.globalIn(refTC), self.globalOut(refTC))
| class Edit():
def globalInOut(self, refTC=None): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def mediaOut(self): ...
def globalIn(self, refTC=None): ...
def globalOut(self, refTC=None): ...
def med... | svenni/editparser | test_get_globalInOut_with_ref_tc | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000050.py |
editparser/__init__.py | TimeCode | mediaIn | import unittest
class Test_TimeCode_mediaIn(unittest.TestCase):
def test_set_mediaIn(self):
new_TC = TimeCode('00:00:00:05', base=24)
self.e.setMediaIn(new_TC)
self.assertEquals(self.e.mediaIn(), new_TC)
| def mediaIn(self):
return self._mediaIn
| class Edit():
def mediaIn(self): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaOut(self): ...
def globalIn(self, refTC=None): ...
def globalOut(self, refTC=None): ...
def mediaInOut(self): ...
def globalInOut(self... | svenni/editparser | test_set_mediaIn | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000051.py |
editparser/__init__.py | TimeCode | mediaOut | import unittest
class Test_TimeCode_mediaOut(unittest.TestCase):
def test_set_mediaOut(self):
new_TC = TimeCode('00:00:00:15', base=24)
self.e.setMediaOut(new_TC)
self.assertEquals(self.e.mediaOut(), new_TC)
| def mediaOut(self):
return self._mediaOut
| class Edit():
def mediaOut(self): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def globalIn(self, refTC=None): ...
def globalOut(self, refTC=None): ...
def mediaInOut(self): ...
def globalInOut(self... | svenni/editparser | test_set_mediaOut | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000052.py |
editparser/__init__.py | TimeCode | globalIn | import unittest
class Test_TimeCode_globalIn(unittest.TestCase):
def test_set_globalIn(self):
new_TC = TimeCode('00:00:00:04', base=24)
self.e.setGlobalIn(new_TC)
self.assertEquals(self.e.globalIn(), new_TC)
| def globalIn(self, refTC=None):
if refTC is None:
refTC = TimeCode(frames=0, base=self._globalIn.base())
return self._globalIn - refTC
| class Edit():
def globalIn(self, refTC=None): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def mediaOut(self): ...
def globalOut(self, refTC=None): ...
def mediaInOut(self): ...
def globalInOut(self... | svenni/editparser | test_set_globalIn | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000053.py |
editparser/__init__.py | TimeCode | globalOut | import unittest
class Test_TimeCode_globalOut(unittest.TestCase):
def test_set_globalOut(self):
new_TC = TimeCode('00:00:00:04', base=24)
self.e.setGlobalOut(new_TC)
self.assertEquals(self.e.globalOut(), new_TC)
| def globalOut(self, refTC=None):
if refTC is None:
refTC = TimeCode(frames=0, base=self._globalOut.base())
return self._globalOut - refTC
| class Edit():
def globalOut(self, refTC=None): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def mediaOut(self): ...
def globalIn(self, refTC=None): ...
def mediaInOut(self): ...
def globalInOut(self... | svenni/editparser | test_set_globalOut | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000054.py |
editparser/__init__.py | TimeCode | setGlobalOut | import unittest
class Test_TimeCode_setGlobalOut(unittest.TestCase):
def test_set_globalOut_wrongBase(self):
new_TC = TimeCode('00:00:00:04', base=10)
with self.assertRaises(EditError):
self.e.setGlobalOut(new_TC)
| def setGlobalOut(self, globalOut):
if globalOut.base() != self._globalOut.base():
raise EditError('Wrong input base! Expected %s, got %s.' % (self._globalOut.base(), globalOut.base()))
self._globalOut = globalOut
| class Edit():
def setGlobalOut(self, globalOut): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def mediaOut(self): ...
def globalIn(self, refTC=None): ...
def globalOut(self, refTC=None): ...
def med... | svenni/editparser | test_set_globalOut_wrongBase | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000055.py |
editparser/__init__.py | null | get | import unittest
class Test_get(unittest.TestCase):
def test_attribute_set_get(self):
self.e.set('integer', 15)
self.e.set('float', 1.0)
self.e.set('string', 'this is')
self.e.set('bool', False)
self.assertEquals(self.e.get('integer'), 15)
self.assertEquals(self.e.get... | def get(self, attribute, default=None):
return self._attributes.get(attribute, default)
| class Edit():
def get(self, attribute, default=None): ...
def __init__(self, mediaIn, mediaOut, globalIn, globalOut, **kwargs): ...
def parse_input_tc(self, tc): ...
def mediaIn(self): ...
def mediaOut(self): ...
def globalIn(self, refTC=None): ...
def globalOut(self, refTC=None): ...
de... | svenni/editparser | test_attribute_set_get | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000056.py |
editparser/__init__.py | null | insertEdit | import unittest
class Test_insertEdit(unittest.TestCase):
def test_insert_edits(self):
self.edl.appendEdit(self.edit_a)
self.assertEquals(self.edl.getAllEdits(), [self.edit_a])
self.edl.insertEdit(0, self.edit_b)
self.assertEquals(self.edl.getAllEdits(), [self.edit_b, self.edit_a])
| def insertEdit(self, index, edit):
self._edits.insert(index, edit)
| class EDL():
def insertEdit(self, index, edit): ...
def __init__(self, title, path, startTimeCode='01:00:00:00', base=25): ...
def appendEdit(self, edit): ...
def getAllEdits(self): ...
def getEdit(self, index): ...
def title(self): ...
def path(self): ...
def start_tc(self): ...
se... | svenni/editparser | test_insert_edits | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000057.py |
editparser/__init__.py | TimeCode | base | import unittest
class Test_TimeCode_base(unittest.TestCase):
def test_base(self):
tc = TimeCode(base=30)
self.assertEquals(tc.base(), 30)
self.assertEquals(tc._frames, 0)
def test_addition_non_default_base(self):
tc1 = TimeCode(frames=25, base=30)
tc2 = TimeCode(frames=... | def base(self):
return self._base
| class TimeCode():
def base(self): ...
def __init__(self, tc='00:00:00:00', frames=0, base=24): ...
def from_msec(self, msec, base=24): ...
def tc(self): ...
def frames(self): ...
def toFrames(self, tc): ...
def __str__(self): ...
def __repr__(self): ...
def __add__(self, other): ...
... | svenni/editparser | test_base | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000058.py |
editparser/__init__.py | null | frames | import unittest
class Test_frames(unittest.TestCase):
def test_get_frames(self):
self.assertEquals(self.tc1.frames(), 4)
| def frames(self):
return self._frames
| class TimeCode():
def frames(self): ...
def __init__(self, tc='00:00:00:00', frames=0, base=24): ...
def from_msec(self, msec, base=24): ...
def base(self): ...
def tc(self): ...
def toFrames(self, tc): ...
def __str__(self): ...
def __repr__(self): ...
def __add__(self, other): ...
... | svenni/editparser | test_get_frames | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000059.py |
editparser/__init__.py | null | toFrames | import unittest
class Test_toFrames(unittest.TestCase):
def test_frames(self):
self.assertEquals(self.tc.toFrames('00:00:00:01'), 1)
| def toFrames(self, tc):
try:
if tc[0] == '-':
tc = tc[1:]
multiplier = -1
else:
multiplier = 1
h, m, s, f = tc.split(':')
except (ValueError, IndexError):
raise RuntimeError('Timecode of invalid format, ... | class TimeCode():
def toFrames(self, tc): ...
def __init__(self, tc='00:00:00:00', frames=0, base=24): ...
def from_msec(self, msec, base=24): ...
def base(self): ...
def tc(self): ...
def frames(self): ...
def __str__(self): ...
def __repr__(self): ...
def __add__(self, other): ...
... | svenni/editparser | test_frames | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000060.py |
editparser/__init__.py | null | from_msec | import unittest
class Test_from_msec(unittest.TestCase):
def test_create_from_msec(self):
tc = TimeCode.from_msec(2520.0, base=25)
self.assertEquals(tc.tc(), '00:00:02:13')
| def from_msec(self, msec, base=24):
millisec = msec % 1000
seconds = int(msec / 1000)
frames = seconds * base + int(base * millisec / 1000)
return TimeCode(frames=frames, base=base)
| class TimeCode():
@classmethod
def from_msec(self, msec, base=24): ...
def __init__(self, tc='00:00:00:00', frames=0, base=24): ...
def base(self): ...
def tc(self): ...
def frames(self): ...
def toFrames(self, tc): ...
def __str__(self): ...
def __repr__(self): ...
def __add__(s... | svenni/editparser | test_create_from_msec | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000061.py |
functionalpy/__init__.py | Seq | fold | import unittest
class Test_Seq_fold(unittest.TestCase):
def test_fold(self):
seq = Seq(1, 2, 3, 4, 5)
expect = 15
actual = seq.fold(lambda x, y: x + y, 0)
self.assertEqual(expect, actual)
| def fold(self, f, x):
return reduce(f, self, x)
| class Seq(listMonadFoldableMonoidGeneric[A]):
def fold(self, f, x): ...
def __init__(self, *values) -> None: ...
def to_seq(iterable): ...
def to_list(self): ...
def map(self, f): ...
def ap(self, fs): ...
def flat_map(self, f): ...
def flatten(self): ...
def fold1(self, f): ...
... | aruneko/FunctionalPy | test_fold | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000062.py |
simplejson/tests/test_encode_basestring_ascii.py | null | _test_encode_basestring_ascii | import unittest
class Test_test_encode_basestring_ascii(unittest.TestCase):
def test_py_encode_basestring_ascii(self):
self._test_encode_basestring_ascii(simplejson.encoder.py_encode_basestring_ascii)
def test_c_encode_basestring_ascii(self):
if not simplejson.encoder.c_encode_basestring_ascii... | def _test_encode_basestring_ascii(self, encode_basestring_ascii):
fname = encode_basestring_ascii.__name__
for input_string, expect in CASES:
result = encode_basestring_ascii(input_string)
self.assertEquals(result, expect, '%r != %r for %s(%r)' % (result, expect, fname, input... | class TestEncodeBaseStringAscii(TestCase):
def _test_encode_basestring_ascii(self, encode_basestring_ascii): ...
def test_py_encode_basestring_ascii(self): ...
def test_c_encode_basestring_ascii(self): ...
def test_sorted_dict(self): ...
| lotooo/vlc-scrobbler | test_py_encode_basestring_ascii | [
1,
1,
0,
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | test_000063.py |
simplejson/__init__.py | null | dumps | import unittest
class Test_dumps(unittest.TestCase):
def test_namedtuple_dumps(self):
for v in [Value(1), Point(1, 2)]:
d = v._asdict()
l = list(v)
self.assertEqual(d, json.loads(json.dumps(v)))
self.assertEqual(d, json.loads(json.dumps(v, namedtuple_as_objec... | def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, encoding='utf-8', default=None, use_decimal=True, namedtuple_as_object=True, tuple_as_array=True, **kw):
"""Serialize ``obj`` to a JSON formatted ``str``.
If ``skipkeys`` is false then... | def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, encoding='utf-8', default=None, use_decimal=True, namedtuple_as_object=True, tuple_as_array=True, **kw): ...
def _import_OrderedDict(): ...
def _import_c_make_encoder(): ...
def dump(obj, fp, s... | lotooo/vlc-scrobbler | test_namedtuple_dumps | [
1,
1,
0,
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000064.py |
simplejson/__init__.py | null | dump | import unittest
class Test_dump(unittest.TestCase):
def test_namedtuple_dump(self):
for v in [Value(1), Point(1, 2)]:
d = v._asdict()
l = list(v)
sio = StringIO()
json.dump(v, sio)
self.assertEqual(d, json.loads(sio.getvalue()))
sio = ... | def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, encoding='utf-8', default=None, use_decimal=True, namedtuple_as_object=True, tuple_as_array=True, **kw):
"""Serialize ``obj`` as a JSON formatted stream to ``fp`` (a
``.write()``-sup... | def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, encoding='utf-8', default=None, use_decimal=True, namedtuple_as_object=True, tuple_as_array=True, **kw): ...
def _import_OrderedDict(): ...
def _import_c_make_encoder(): ...
def dump(obj, fp... | lotooo/vlc-scrobbler | test_namedtuple_dump | [
1,
1,
0,
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
1,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000065.py |
pycscope/__init__.py | null | genFiles | import unittest
class Test_genFiles(unittest.TestCase):
def testgenfiles(self):
tmpd = tempfile.mkdtemp()
try:
with open(os.path.join(tmpd, 'a.py'), 'w') as a:
a.write('a = 1\n')
with open(os.path.join(tmpd, 'b'), 'w') as b:
b.write('b = 1\n')... | def genFiles(basepath, args, recurse, exclude):
""" A generator for returning all the files that need to be parsed.
Caller is required to provide synchronization.
"""
for name in sorted(args):
name_n = os.path.normpath(name)
if name_n in exclude:
continue
if os.pa... | def genFiles(basepath, args, recurse, exclude): ...
def main(argv=None): ...
def writeIndex(basepath, fout, indexbuff, fnamesbuff): ...
def work(basepath, gen, debug): ...
def isPython(name): ...
def genFiles(basepath, args, recurse, exclude): ...
def parseDir(basepath, relpath, recurse, exclude): ...
def parseFile(bas... | portante/pycscope | testgenfiles | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000066.py |
pycscope/__init__.py | Symbol | format | import unittest
class Test_Symbol_format(unittest.TestCase):
def testFormat(self):
s = Symbol('hi')
self.assertEqual('hi', s.format())
s = Symbol('bye', '~')
self.assertEqual('\t~bye', s.format())
| def format(self):
""" Marks are represented as a string with a tab character
followed by the mark character itself, if it has
one. Otherwise it is an empty string.
"""
if self.__mark:
return '\t%s' % self.__mark
else:
return... | class Mark(object):
def format(self): ...
def __init__(self, mark=''): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def __repr__(self): ...
def __getattr__(self, name): ...
self.__mark = mark or ''
FILE = '@'
FUNC_DEF = '$'
FUNC_CALL = '`'
FUNC_END = '}'
... | portante/pycscope | testFormat | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000067.py |
pycscope/__init__.py | null | work | import unittest
class Test_work(unittest.TestCase):
def testwork(self):
tmpd = tempfile.mkdtemp()
try:
with open(os.path.join(tmpd, 'a'), 'w') as a:
a.write('a = 1\n')
with open(os.path.join(tmpd, 'b'), 'w') as b:
b.write('b = 1\n')
... | def work(basepath, gen, debug):
""" The actual work of parsing the files.
"""
indexbuff = []
indexbuff_len = 0
fnamesbuff = []
for fname in gen:
try:
indexbuff_len = parseFile(basepath, fname, indexbuff, indexbuff_len, fnamesbuff, dump=debug)
except (SyntaxError, Asse... | def work(basepath, gen, debug): ...
def main(argv=None): ...
def writeIndex(basepath, fout, indexbuff, fnamesbuff): ...
def work(basepath, gen, debug): ...
def isPython(name): ...
def genFiles(basepath, args, recurse, exclude): ...
def parseDir(basepath, relpath, recurse, exclude): ...
def parseFile(basepath, relpath, ... | portante/pycscope | testwork | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000068.py |
gluster/swift/common/middleware/gswauth/swauth/authtypes.py | null | encode | import unittest
class Test_encode(unittest.TestCase):
def test_plaintext_encode(self):
enc_key = self.auth_encoder.encode('keystring')
self.assertEquals('plaintext:keystring', enc_key)
def test_sha1_encode(self):
enc_key = self.auth_encoder.encode('keystring')
self.assertEquals... | def encode(self, key):
"""
Encodes a user key into a particular format. The result of this method
will be used by swauth for storing user credentials.
:param key: User's secret key
:returns: A string representing user credentials
"""
r... | class Plaintext(object):
def encode(self, key): ...
def match(self, key, creds): ...
| portante/gluster-swift | test_plaintext_encode | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000069.py |
gluster/swift/common/middleware/gswauth/swauth/authtypes.py | null | match | import unittest
class Test_match(unittest.TestCase):
def test_plaintext_valid_match(self):
creds = 'plaintext:keystring'
match = self.auth_encoder.match('keystring', creds)
self.assertEquals(match, True)
def test_plaintext_invalid_match(self):
creds = 'plaintext:other-keystring... | def match(self, key, creds):
"""
Checks whether the user-provided key matches the user's credentials
:param key: User-supplied key
:param creds: User's stored credentials
:returns: True if the supplied key is valid, False otherwise
"""
... | class Plaintext(object):
def match(self, key, creds): ...
def encode(self, key): ...
| portante/gluster-swift | test_plaintext_valid_match | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000070.py |
test/unit/common/middleware/gswauth/swauth/test_middleware.py | null | _make_request | import unittest
class Test_make_request(unittest.TestCase):
def test_detect_reseller_request(self):
req = self._make_request('/v1/AUTH_admin', headers={'X-Auth-Token': 'AUTH_t'})
cache_key = 'AUTH_/auth/AUTH_t'
cache_entry = (time() + 3600, '.reseller_admin')
req.environ['swift.cach... | def _make_request(self, path, **kwargs):
req = Request.blank(path, **kwargs)
req.environ['swift.cache'] = FakeMemcache()
return req
| class TestAuth(unittest.TestCase):
def _make_request(self, path, **kwargs): ...
def setUp(self): ...
def test_super_admin_key_not_required(self): ...
def test_reseller_prefix_init(self): ...
def test_auth_prefix_init(self): ...
def test_no_auth_type_init(self): ...
def test_valid_auth_type_i... | portante/gluster-swift | test_detect_reseller_request | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000071.py |
test/unit/common/middleware/gswauth/swauth/test_middleware.py | null | _get_token_success_v1_0_encoded | import unittest
class Test_get_token_success_v1_0_encoded(unittest.TestCase):
def test_get_token_success_v1_0_encoded1(self):
self._get_token_success_v1_0_encoded('act:usr', 'key', 'act%3ausr', 'key')
def test_get_token_success_v1_0_encoded2(self):
self._get_token_success_v1_0_encoded('act:u s... | def _get_token_success_v1_0_encoded(self, saved_user, saved_key, sent_user, sent_key):
self.test_auth.app = FakeApp(iter([('200 Ok', {}, json.dumps({'auth': 'plaintext:%s' % saved_key, 'groups': [{'name': saved_user}, {'name': 'act'}, {'name': '.admin'}]})), ('204 Ok', {'X-Container-Meta-Account-Id': 'AUTH_... | class TestAuth(unittest.TestCase):
def _get_token_success_v1_0_encoded(self, saved_user, saved_key, sent_user, sent_key): ...
def setUp(self): ...
def test_super_admin_key_not_required(self): ...
def test_reseller_prefix_init(self): ...
def test_auth_prefix_init(self): ...
def test_no_auth_type_... | portante/gluster-swift | test_get_token_success_v1_0_encoded1 | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | test_000072.py |
gluster/swift/common/Glusterfs.py | null | _busy_wait | import unittest
class Test_busy_wait(unittest.TestCase):
def test_busy_wait_timeout(self):
os.path.ismount = mock_os_path_ismount_false
real_time_sleep = time.sleep
time.sleep = mock_time_sleep
try:
self.assertFalse(gfs._busy_wait('/'))
finally:
time.... | def _busy_wait(full_mount_path):
for i in range(0, 5):
if os.path.ismount(full_mount_path):
return True
time.sleep(2)
logging.error('Busy wait for mount timed out for mount %s', full_mount_path)
return False | def _busy_wait(full_mount_path): ...
def _busy_wait(full_mount_path): ...
def _get_unique_id(): ...
def _get_drive_mount_point_name(drive): ...
def mount(root, drive): ...
def unmount(full_mount_path): ...
def _get_export_list(): ...
| portante/gluster-swift | test_busy_wait_timeout | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000073.py |
gluster/swift/common/Glusterfs.py | null | mount | import unittest
class Test_mount(unittest.TestCase):
def test_mount(self):
try:
tmpdir = mkdtemp()
root = os.path.join(tmpdir, 'mnt/gluster-object')
drive = 'test'
_init_mock_variables(tmpdir)
assert gfs.mount(root, drive)
finally:
... | def mount(root, drive):
"""
Verify that the path to the device is a mount point and mounted. This
allows us to fast fail on drives that have been unmounted because of
issues, and also prevents us for accidentally filling up the root
partition.
This method effectively replaces the swift.common.... | def mount(root, drive): ...
def _busy_wait(full_mount_path): ...
def _get_unique_id(): ...
def _get_drive_mount_point_name(drive): ...
def mount(root, drive): ...
def unmount(full_mount_path): ...
def _get_export_list(): ...
| portante/gluster-swift | test_mount | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000074.py |
gluster/swift/common/constraints.py | null | set_object_name_component_length | import unittest
class Test_set_object_name_component_length(unittest.TestCase):
def test_set_object_name_component_length(self):
len = cnt.get_object_name_component_length()
cnt.set_object_name_component_length(len + 1)
self.assertEqual(len, cnt.get_object_name_component_length() - 1)
... | def set_object_name_component_length(len=None):
global MAX_OBJECT_NAME_COMPONENT_LENGTH
if len:
MAX_OBJECT_NAME_COMPONENT_LENGTH = len
elif hasattr(swift.common.constraints, 'constraints_conf_int'):
MAX_OBJECT_NAME_COMPONENT_LENGTH = swift.common.constraints.constraints_conf_int('max_object_... | def set_object_name_component_length(len=None): ...
def set_object_name_component_length(len=None): ...
def get_object_name_component_length(): ...
def validate_obj_name_component(obj): ...
def gluster_check_object_creation(req, object_name): ...
| portante/gluster-swift | test_set_object_name_component_length | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000075.py |
gluster/swift/common/constraints.py | null | validate_obj_name_component | import unittest
class Test_validate_obj_name_component(unittest.TestCase):
def test_validate_obj_name_component(self):
max_obj_len = cnt.get_object_name_component_length()
self.assertFalse(cnt.validate_obj_name_component('tests' * (max_obj_len / 5)))
cnt.set_object_name_component_length(300... | def validate_obj_name_component(obj):
if not obj:
return "cannot begin, end, or have contiguous %s's" % os.path.sep
if len(obj) > MAX_OBJECT_NAME_COMPONENT_LENGTH:
return 'too long (%d)' % len(obj)
if obj == '.' or obj == '..':
return 'cannot be . or ..'
return '' | def validate_obj_name_component(obj): ...
def set_object_name_component_length(len=None): ...
def get_object_name_component_length(): ...
def validate_obj_name_component(obj): ...
def gluster_check_object_creation(req, object_name): ...
| portante/gluster-swift | test_validate_obj_name_component | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000076.py |
gluster/swift/common/constraints.py | null | gluster_check_object_creation | import unittest
class Test_gluster_check_object_creation(unittest.TestCase):
def test_gluster_check_object_creation(self):
with patch('gluster.swift.common.constraints.__check_object_creation', mock_check_object_creation):
self.assertFalse(cnt.gluster_check_object_creation(None, 'dir/z'))
... | def gluster_check_object_creation(req, object_name):
"""
Check to ensure that everything is alright about an object to be created.
Monkey patches swift.common.constraints.check_object_creation, invoking
the original, and then adding an additional check for individual object
name components.
:pa... | def gluster_check_object_creation(req, object_name): ...
def set_object_name_component_length(len=None): ...
def get_object_name_component_length(): ...
def validate_obj_name_component(obj): ...
def gluster_check_object_creation(req, object_name): ...
| portante/gluster-swift | test_gluster_check_object_creation | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000077.py |
gluster/swift/common/DiskDir.py | null | _read_metadata | import unittest
class Test_read_metadata(unittest.TestCase):
def test__read_metadata(self):
def fake_read_metadata(p):
return {'a': 1, 'b': ('c', 5)}
orig_rm = dd.read_metadata
dd.read_metadata = fake_read_metadata
try:
md = dd._read_metadata('/tmp/foo')
... | def _read_metadata(dd):
""" Filter read metadata so that it always returns a tuple that includes
some kind of timestamp. With 1.4.8 of the Swift integration the
timestamps were not stored. Here we fabricate timestamps for volumes
where the existing data has no timestamp (that is, stored data... | def _read_metadata(dd): ...
def _read_metadata(dd): ...
def filter_prefix(objects, prefix): ...
def filter_delimiter(objects, delimiter, prefix, marker, path=None): ...
def filter_marker(objects, marker): ...
def filter_prefix_as_marker(objects, prefix): ...
def filter_end_marker(objects, end_marker): ...
| portante/gluster-swift | test__read_metadata | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000078.py |
gluster/swift/common/DiskDir.py | null | filter_end_marker | import unittest
class Test_filter_end_marker(unittest.TestCase):
def test_filter_end_marker(self):
in_objs, end_marker = ([], '')
out_objs = dd.filter_end_marker(in_objs, end_marker)
assert list(out_objs) == []
in_objs, end_marker = ([], 'abc')
out_objs = dd.filter_end_marke... | def filter_end_marker(objects, end_marker):
"""
Accept a list of strings, sorted, and return all the strings that are
strictly less than the given end_marker string. We perform this as a
generator to avoid creating potentially large intermediate object lists.
"""
for object_name in objects:
... | def filter_end_marker(objects, end_marker): ...
def _read_metadata(dd): ...
def filter_prefix(objects, prefix): ...
def filter_delimiter(objects, delimiter, prefix, marker, path=None): ...
def filter_marker(objects, marker): ...
def filter_prefix_as_marker(objects, prefix): ...
def filter_end_marker(objects, end_marker... | portante/gluster-swift | test_filter_end_marker | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000079.py |
gluster/swift/common/DiskDir.py | null | filter_marker | import unittest
class Test_filter_marker(unittest.TestCase):
def test_filter_marker(self):
in_objs, marker = ([], '')
out_objs = dd.filter_marker(in_objs, marker)
assert list(out_objs) == []
in_objs, marker = ([], 'abc')
out_objs = dd.filter_marker(in_objs, marker)
a... | def filter_marker(objects, marker):
"""
Accept sorted list of strings, return all strings whose value is strictly
greater than the given marker value.
"""
for object_name in objects:
if object_name > marker:
yield object_name | def filter_marker(objects, marker): ...
def _read_metadata(dd): ...
def filter_prefix(objects, prefix): ...
def filter_delimiter(objects, delimiter, prefix, marker, path=None): ...
def filter_marker(objects, marker): ...
def filter_prefix_as_marker(objects, prefix): ...
def filter_end_marker(objects, end_marker): ...
| portante/gluster-swift | test_filter_marker | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000080.py |
gluster/swift/common/DiskDir.py | null | filter_prefix | import unittest
class Test_filter_prefix(unittest.TestCase):
def test_filter_prefix(self):
in_objs, prefix = ([], '')
out_objs = dd.filter_prefix(in_objs, prefix)
assert list(out_objs) == []
in_objs, prefix = ([], 'abc')
out_objs = dd.filter_prefix(in_objs, prefix)
a... | def filter_prefix(objects, prefix):
"""
Accept a sorted list of strings, returning all strings starting with the
given prefix.
"""
found = False
for object_name in objects:
if object_name.startswith(prefix):
yield object_name
found = True
elif found:
... | def filter_prefix(objects, prefix): ...
def _read_metadata(dd): ...
def filter_prefix(objects, prefix): ...
def filter_delimiter(objects, delimiter, prefix, marker, path=None): ...
def filter_marker(objects, marker): ...
def filter_prefix_as_marker(objects, prefix): ...
def filter_end_marker(objects, end_marker): ...
| portante/gluster-swift | test_filter_prefix | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000081.py |
gluster/swift/common/DiskDir.py | null | filter_delimiter | import unittest
class Test_filter_delimiter(unittest.TestCase):
def test_filter_delimiter(self):
in_objs, delimiter, prefix, marker = ([], None, '', '')
try:
out_objs = dd.filter_delimiter(in_objs, delimiter, prefix, marker)
except AssertionError:
pass
except... | def filter_delimiter(objects, delimiter, prefix, marker, path=None):
"""
Accept a sorted list of strings, returning strings that:
1. begin with "prefix" (empty string matches all)
2. does not match the "path" argument
3. does not contain the delimiter in the given prefix length
"""
ass... | def filter_delimiter(objects, delimiter, prefix, marker, path=None): ...
def _read_metadata(dd): ...
def filter_prefix(objects, prefix): ...
def filter_delimiter(objects, delimiter, prefix, marker, path=None): ...
def filter_marker(objects, marker): ...
def filter_prefix_as_marker(objects, prefix): ...
def filter_end_m... | portante/gluster-swift | test_filter_delimiter | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
1,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000082.py |
gluster/swift/common/DiskDir.py | null | _dir_exists_read_metadata | import unittest
class Test_dir_exists_read_metadata(unittest.TestCase):
def test__dir_exists_read_metadata_exists(self):
datadir = os.path.join(self.td, self.fake_drives[0])
fake_md = {'fake': (True, 0)}
fake_md_p = pickle.dumps(fake_md, utils.PICKLE_PROTOCOL)
_setxattr(datadir, uti... | def _dir_exists_read_metadata(self):
self._dir_exists = os_path.exists(self.datadir)
if self._dir_exists:
self.metadata = _read_metadata(self.datadir)
return self._dir_exists
| class DiskCommon(object):
def _dir_exists_read_metadata(self): ...
def __init__(self, root, drive, account, logger, pending_timeout=None, stale_reads_ok=False): ...
def is_deleted(self): ...
def empty(self): ...
def update_metadata(self, metadata): ...
self.db_file = _db_file
self.metadata ... | portante/gluster-swift | test__dir_exists_read_metadata_exists | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000083.py |
gluster/swift/common/DiskDir.py | null | is_deleted | import unittest
class Test_is_deleted(unittest.TestCase):
def test_is_deleted(self):
dc = dd.DiskCommon(self.td, self.fake_drives[0], self.fake_accounts[0], self.fake_logger)
assert dc.is_deleted() == False
| def is_deleted(self):
return not os_path.exists(self.datadir)
| class DiskCommon(object):
def is_deleted(self): ...
def __init__(self, root, drive, account, logger, pending_timeout=None, stale_reads_ok=False): ...
def _dir_exists_read_metadata(self): ...
def empty(self): ...
def update_metadata(self, metadata): ...
self.db_file = _db_file
self.metadata ... | portante/gluster-swift | test_is_deleted | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000084.py |
gluster/swift/common/DiskDir.py | null | update_metadata | import unittest
class Test_update_metadata(unittest.TestCase):
def test_update_metadata(self):
dc = dd.DiskCommon(self.td, self.fake_drives[0], self.fake_accounts[0], self.fake_logger)
utils.create_container_metadata(dc.datadir)
dc.metadata = dd._read_metadata(dc.datadir)
md_copy = ... | def update_metadata(self, metadata):
assert self.metadata, 'Valid container/account metadata should have been created by now'
if metadata:
new_metadata = self.metadata.copy()
new_metadata.update(metadata)
if new_metadata != self.metadata:
write_met... | class DiskCommon(object):
def update_metadata(self, metadata): ...
def __init__(self, root, drive, account, logger, pending_timeout=None, stale_reads_ok=False): ...
def _dir_exists_read_metadata(self): ...
def is_deleted(self): ...
def empty(self): ...
self.db_file = _db_file
self.metadata ... | portante/gluster-swift | test_update_metadata | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
1,
0,
1,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000085.py |
gluster/swift/common/DiskDir.py | null | empty | import unittest
class Test_empty(unittest.TestCase):
def test_empty_dir_is_not_empty(self):
dc = dd.DiskCommon(self.td, self.fake_drives[0], self.fake_accounts[0], self.fake_logger)
os.makedirs(os.path.join(self.td, self.fake_drives[0], 'aaabbbccc'))
self.assertFalse(dc.empty())
def te... | def empty(self):
try:
return dir_empty(self.datadir)
except FileOrDirNotFoundError:
return True
| class DiskCommon(object):
def empty(self): ...
def __init__(self, root, drive, account, logger, pending_timeout=None, stale_reads_ok=False): ...
def _dir_exists_read_metadata(self): ...
def is_deleted(self): ...
def update_metadata(self, metadata): ...
self.db_file = _db_file
self.metadata ... | portante/gluster-swift | test_empty_dir_is_not_empty | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000086.py |
gluster/swift/common/DiskDir.py | null | put_object | import unittest
class Test_put_object(unittest.TestCase):
def test_put_object(self):
broker = self._get_broker(account='a', container='c')
broker.initialize(self.initial_ts)
self.assert_(broker.empty())
broker.put_object('o', normalize_timestamp(time()), 0, 'text/plain', 'd41d8cd98f... | def put_object(self, name, timestamp, size, content_type, etag, deleted=0):
pass
| class DiskDir(DiskCommon):
def put_object(self, name, timestamp, size, content_type, etag, deleted=0): ...
def __init__(self, path, drive, account, container, logger, uid=DEFAULT_UID, gid=DEFAULT_GID, **kwargs): ...
def list_objects_iter(self, limit, marker, end_marker, prefix, delimiter, path=None): ...
... | portante/gluster-swift | test_put_object | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000087.py |
gluster/swift/common/DiskDir.py | null | delete_object | import unittest
class Test_delete_object(unittest.TestCase):
def test_delete_object(self):
broker = self._get_broker(account='a', container='c')
broker.initialize(self.initial_ts)
self.assert_(broker.empty())
obj = self._create_file('o.txt')
self.assert_(not broker.empty())
... | def delete_object(self, name, timestamp):
return
| class DiskDir(DiskCommon):
def delete_object(self, name, timestamp): ...
def __init__(self, path, drive, account, container, logger, uid=DEFAULT_UID, gid=DEFAULT_GID, **kwargs): ...
def list_objects_iter(self, limit, marker, end_marker, prefix, delimiter, path=None): ...
def _update_object_count(self): ... | portante/gluster-swift | test_delete_object | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000088.py |
gluster/swift/common/DiskDir.py | null | get_info | import unittest
class Test_get_info(unittest.TestCase):
def test_get_info(self):
tf = tarfile.open('common/data/account_tree.tar.bz2', 'r:bz2')
orig_cwd = os.getcwd()
os.chdir(os.path.join(self.td, self.fake_drives[0]))
try:
tf.extractall()
finally:
o... | def get_info(self):
"""
Get global data for the container.
:returns: dict with keys: account, container, object_count, bytes_used,
hash, id, created_at, put_timestamp, delete_timestamp,
reported_put_timestamp, reported_delete_timest... | class DiskDir(DiskCommon):
def get_info(self): ...
def __init__(self, path, drive, account, container, logger, uid=DEFAULT_UID, gid=DEFAULT_GID, **kwargs): ...
def list_objects_iter(self, limit, marker, end_marker, prefix, delimiter, path=None): ...
def _update_object_count(self): ...
def put_object... | portante/gluster-swift | test_get_info | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | test_000089.py |
gluster/swift/common/DiskDir.py | null | list_objects_iter | import unittest
class Test_list_objects_iter(unittest.TestCase):
def test_list_objects_iter(self):
broker = self._get_broker(account='a', container='c')
broker.initialize(self.initial_ts)
for obj1 in xrange(4):
for obj2 in xrange(125):
self._create_file('%d.d/%04... | def list_objects_iter(self, limit, marker, end_marker, prefix, delimiter, path=None):
"""
Returns tuple of name, created_at, size, content_type, etag.
"""
assert limit >= 0
assert not delimiter or (len(delimiter) == 1 and ord(delimiter) <= 254)
if path is not ... | class DiskDir(DiskCommon):
def list_objects_iter(self, limit, marker, end_marker, prefix, delimiter, path=None): ...
def __init__(self, path, drive, account, container, logger, uid=DEFAULT_UID, gid=DEFAULT_GID, **kwargs): ...
def _update_object_count(self): ...
def get_info(self): ...
def put_object... | portante/gluster-swift | test_list_objects_iter | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"AssertionRoulette",
"ConditionalTestLogic",
"ConstructorInitialization",
"DefaultTest",
"DuplicateAssertion",
"EmptyTest",
"ExceptionHandling",
"GeneralFixture",
"IgnoredTest",
"LackCohesion",
"MagicNumberTest",
"ObscureInLineSetup",
"RedundantAssertion",
"RedundantPrint",
"SleepyTest",... | [
0,
1,
0,
0,
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | test_000090.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.