repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
JWock82/Pynite | import sys
sys.path.insert(0, r'c:\Users\craig\Documents\Python\Pynite')
from Pynite import FEModel3D
def test_mesh_regeneration_with_shared_nodes():
"""Test that nodes shared with other elements are preserved during regeneration."""
print("\n=== Test 2: Shared Nodes Preservation ===")
# Create ... | model.nodes | assert | complex_expr | Testing/test_mesh_regen_simple.py | test_mesh_regeneration_with_shared_nodes | 95 | null | |
JWock82/Pynite | import unittest
from Pynite import FEModel3D, Section
import sys
from io import StringIO
class TestLoads(unittest.TestCase):
def setUp(self):
# Suppress printed output temporarily
sys.stdout = StringIO()
def tearDown(self):
# Reset the print function to normal
sys.stdout = sys... | ValueError) | self.assertRaises | variable | Testing/test_loads.py | test_member_self_weight_local_direction | TestLoads | 58 | null |
JWock82/Pynite | import enum
import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO
class Test_AISC_Benchmark(unittest.TestCase):
def setUp(self):
# Suppress printed output temporarily
# sys.stdout = StringIO()
pass
def tearDown(self):
# Reset the... | 0.03) | self.assertLessEqual | numeric_literal | Testing/test_AISC_PDelta_benchmarks.py | test_AISC_benchmark_case2 | Test_AISC_Benchmark | 226 | null |
JWock82/Pynite | import pytest
from Pynite import FEModel3D
def test_multiple_meshes_independent_regeneration():
"""Test that regenerating one mesh doesn't affect other meshes."""
# Create a model
model = FEModel3D()
model.add_material('Steel', 29000, 11200, 0.3, 490)
# Add two separate meshes
mesh1_n... | mesh2_elements | assert | variable | Testing/test_mesh_regeneration.py | test_multiple_meshes_independent_regeneration | 194 | null | |
JWock82/Pynite | import pytest
from Pynite import FEModel3D
def test_mesh_regeneration_with_shared_nodes():
"""Test that nodes shared with other elements are preserved during regeneration."""
# Create a model
model = FEModel3D()
model.add_material('Steel', 29000, 11200, 0.3, 490)
# Add a rectangle mesh
... | model.quads | assert | complex_expr | Testing/test_mesh_regeneration.py | test_mesh_regeneration_with_shared_nodes | 87 | null | |
JWock82/Pynite | import unittest
from Pynite import FEModel3D
class TestNode3D(unittest.TestCase):
def setUp(self):
self.model = FEModel3D()
self.model.add_node('N1', 0, 0, 0)
self.node = self.model.nodes['N1']
def test_node_creation(self):
"""Test basic node creation."""
self.assertEq... | 0) | self.assertEqual | numeric_literal | Testing/test_node_spring_coverage.py | test_node_creation | TestNode3D | 20 | null |
JWock82/Pynite | from __future__ import annotations
import pytest
from Pynite.FEModel3D import FEModel3D
def test_no_merge_unique_nodes():
model = FEModel3D()
model.add_node("N1", 0.0, 0.0, 0.0)
model.add_node("N2", 1.0, 0.0, 0.0)
removed = model.merge_duplicate_nodes(tolerance=1e-6)
assert removed == []
as... | {"N1", "N2"} | assert | collection | Testing/test_node_merge.py | test_no_merge_unique_nodes | 30 | null | |
JWock82/Pynite | from Pynite import FEModel3D
import numpy as np
def test_spring_elements():
# A First Course in the Finite Element Method, 4th Edition
# Daryl L. Logan
# Example 2.1
# Units for this model are pounds and inches
system = FEModel3D()
system.add_node('1', 0, 0, 0)
system.add_node('2', 30, 0,... | round(10/11, 4) | assert | func_call | Testing/test_springs.py | test_spring_elements | 45 | null | |
JWock82/Pynite | import os
import pytest
import vtk
from io import BytesIO
from IPython.display import Image
from Pynite import FEModel3D
from Pynite import Visualization as VTKVis
from Pynite.Visualization import Renderer as VTKRenderer
from Pynite.Rendering import Renderer as PVRenderer
import pyvista as pv
pv.OFF_SCREEN = True
def... | 4 | assert | numeric_literal | Testing/test_Visualization.py | test_member_end_release_visuals | 351 | null | |
JWock82/Pynite | import sys
sys.path.insert(0, r'c:\Users\craig\Documents\Python\Pynite')
from Pynite import FEModel3D
def test_rectangle_mesh_regeneration():
"""Test that regenerating a RectangleMesh removes old nodes/elements."""
print("\n=== Test 1: Rectangle Mesh Regeneration ===")
# Create a simple model
... | initial_element_count | assert | variable | Testing/test_mesh_regen_simple.py | test_rectangle_mesh_regeneration | 46 | null | |
JWock82/Pynite | import os
import pytest
import vtk
from io import BytesIO
from IPython.display import Image
from Pynite import FEModel3D
from Pynite import Visualization as VTKVis
from Pynite.Visualization import Renderer as VTKRenderer
from Pynite.Rendering import Renderer as PVRenderer
import pyvista as pv
pv.OFF_SCREEN = True
def... | 0.5) | pytest.approx | numeric_literal | Testing/test_Visualization.py | test_annotation_size_auto_two_nodes | 229 | null | |
JWock82/Pynite | import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO
class Test_2D_Frame(unittest.TestCase):
def setUp(self):
# Suppress printed output temporarily
sys.stdout = StringIO()
def tearDown(self):
# Reset the print function to normal
sys.stdou... | 0.7) | self.assertLess | numeric_literal | Testing/test_2D_frames.py | test_Kassimali_3_35 | Test_2D_Frame | 289 | null |
JWock82/Pynite | from __future__ import annotations
import pytest
from Pynite.FEModel3D import FEModel3D
def test_cluster_merge_and_element_rewire():
model = FEModel3D()
# Tight cluster around origin; all should collapse to first added node
n1 = model.add_node("N1", 0.0, 0.0, 0.0)
n2 = model.add_node("N2", 0.0004, 0.... | {"N1"} | assert | collection | Testing/test_node_merge.py | test_cluster_merge_and_element_rewire | 74 | null | |
JWock82/Pynite | from __future__ import annotations
import pytest
from Pynite.FEModel3D import FEModel3D
def test_pair_not_merged_when_beyond_tolerance():
model = FEModel3D()
model.add_node("A", 0.0, 0.0, 0.0)
# Distance is slightly greater than tolerance
model.add_node("B", 0.0, 0.0, 0.0011)
removed = model.mer... | {"A", "B"} | assert | collection | Testing/test_node_merge.py | test_pair_not_merged_when_beyond_tolerance | 56 | null | |
JWock82/Pynite | import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO
class Test_2D_Frame(unittest.TestCase):
def setUp(self):
# Suppress printed output temporarily
sys.stdout = StringIO()
def tearDown(self):
# Reset the print function to normal
sys.stdou... | 2) | self.assertAlmostEqual | numeric_literal | Testing/test_2D_frames.py | test_XY_member_ptload | Test_2D_Frame | 121 | null |
JWock82/Pynite | import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO
class Test_End_Release(unittest.TestCase):
def setUp(self):
# Suppress printed output temporarily
sys.stdout = StringIO()
def tearDown(self):
# Reset the print function to normal
sys.st... | 2) | self.assertAlmostEqual | numeric_literal | Testing/test_torsion.py | test_member_torque_load | Test_End_Release | 47 | null |
JWock82/Pynite | from Pynite import FEModel3D
import pytest as pt
def test_beam_rotation():
# Create a model
beam = FEModel3D()
# Add nodes to the model
beam.add_node('N1', 0, 0, 0)
beam.add_node('N2', 10, 0, 0)
# Define supports
beam.def_support('N1', True, True, True, True, False, False)
beam.def_s... | pt.approx(17.677, rel=1e-2) | assert | func_call | Testing/test_member_rotation.py | test_beam_rotation | 41 | null | |
JWock82/Pynite | import pytest
from Pynite import FEModel3D
def test_multiple_meshes_independent_regeneration():
"""Test that regenerating one mesh doesn't affect other meshes."""
# Create a model
model = FEModel3D()
model.add_material('Steel', 29000, 11200, 0.3, 490)
# Add two separate meshes
mesh1_n... | mesh2_nodes | assert | variable | Testing/test_mesh_regeneration.py | test_multiple_meshes_independent_regeneration | 192 | null | |
JWock82/Pynite | import unittest
from numpy import True_
from Pynite import FEModel3D
import sys
from io import StringIO
class Test_Unstable(unittest.TestCase):
def setUp(self):
# Suppress printed output temporarily
sys.stdout = StringIO()
def tearDown(self):
# Reset the print function to normal
... | Exception) | self.assertRaises | variable | Testing/test_unstable_structure.py | test_unstable_supports | Test_Unstable | 63 | null |
JWock82/Pynite | import sys
sys.path.insert(0, r'c:\Users\craig\Documents\Python\Pynite')
from Pynite import FEModel3D
def test_delete_mesh_flags_unsolved():
"""Test that deleting a mesh flags the model as unsolved."""
print("\n=== Test 6: Delete Mesh Flags Model as Unsolved ===")
# Create a model
model = FE... | None | assert | none_literal | Testing/test_delete_mesh.py | test_delete_mesh_flags_unsolved | 302 | null | |
JWock82/Pynite | from Pynite import FEModel3D
from Pynite.Rendering import Renderer
from math import isclose
def test_piers_and_coupling_beams():
# Create a new finite element model
model = FEModel3D()
# Define a material for our shear wall
fm = 2000/1000*144 # ksf
Em = 900*fm # ksf
Gm = 0.4*Em # ksf
n... | -round(P3, 3) | assert | func_call | Testing/test_shear_wall.py | test_piers_and_coupling_beams | 134 | null | |
JWock82/Pynite | import os
import pytest
import vtk
from io import BytesIO
from IPython.display import Image
from Pynite import FEModel3D
from Pynite import Visualization as VTKVis
from Pynite.Visualization import Renderer as VTKRenderer
from Pynite.Rendering import Renderer as PVRenderer
import pyvista as pv
pv.OFF_SCREEN = True
def... | 0 | assert | numeric_literal | Testing/test_Visualization.py | test_visnode_support_fixed_and_pinned | 311 | null | |
JWock82/Pynite | import unittest
import numpy as np
from Pynite import FEModel3D
from Pynite.Material import Material
from Pynite.Section import Section, SteelSection
from Pynite.LoadCombo import LoadCombo
class TestLoadCombo(unittest.TestCase):
def test_loadcombo_creation_with_factors(self):
"""Test creating load combina... | 1.6) | self.assertEqual | numeric_literal | Testing/test_material_section_coverage.py | test_loadcombo_creation_with_factors | TestLoadCombo | 54 | null |
JWock82/Pynite | import sys
sys.path.insert(0, r'c:\Users\craig\Documents\Python\Pynite')
from Pynite import FEModel3D
def test_delete_multiple_meshes():
"""Test deleting multiple meshes independently."""
print("\n=== Test 5: Delete Multiple Meshes ===")
# Create a model
model = FEModel3D()
model.add_mat... | mesh2_quad_count | assert | variable | Testing/test_delete_mesh.py | test_delete_multiple_meshes | 264 | null | |
JWock82/Pynite | from Pynite import FEModel3D
from Pynite.Rendering import Renderer
from math import isclose
def test_quad_shear_wall():
sw = FEModel3D()
# Add a material
E = 57000*(4000)**0.5/1000*12**2
nu = 0.17
G = E/(2*(1 + nu))
sw.add_material('Concrete', E, G, nu, 0.150)
# Define section properties... | 0.001 | assert | numeric_literal | Testing/test_shear_wall.py | test_quad_shear_wall | 175 | null | |
JWock82/Pynite | import unittest
import numpy as np
from Pynite import FEModel3D
from Pynite.Material import Material
from Pynite.Section import Section, SteelSection
from Pynite.LoadCombo import LoadCombo
class TestSteelSection(unittest.TestCase):
def setUp(self):
self.model = FEModel3D()
self.model.add_material(... | 14.1) | self.assertEqual | numeric_literal | Testing/test_material_section_coverage.py | test_steel_section_creation | TestSteelSection | 141 | null |
JWock82/Pynite | import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO
class Test_2D_Frame(unittest.TestCase):
def setUp(self):
# Suppress printed output temporarily
sys.stdout = StringIO()
def tearDown(self):
# Reset the print function to normal
sys.stdou... | 0.1) | self.assertLess | numeric_literal | Testing/test_2D_frames.py | test_Kassimali_3_35 | Test_2D_Frame | 287 | null |
JWock82/Pynite | import sys
sys.path.insert(0, r'c:\Users\craig\Documents\Python\Pynite')
from Pynite import FEModel3D
def test_multiple_meshes_independent_regeneration():
"""Test that regenerating one mesh doesn't affect other meshes."""
print("\n=== Test 4: Independent Mesh Regeneration ===")
# Create a model
... | mesh2_nodes | assert | variable | Testing/test_mesh_regen_simple.py | test_multiple_meshes_independent_regeneration | 175 | null | |
JWock82/Pynite | import sys
sys.path.insert(0, r'c:\Users\craig\Documents\Python\Pynite')
from Pynite import FEModel3D
def test_rectangle_mesh_regeneration():
"""Test that regenerating a RectangleMesh removes old nodes/elements."""
print("\n=== Test 1: Rectangle Mesh Regeneration ===")
# Create a simple model
... | initial_node_count | assert | variable | Testing/test_mesh_regen_simple.py | test_rectangle_mesh_regeneration | 44 | null | |
JWock82/Pynite | from Pynite import FEModel3D
import numpy as np
def test_spring_elements():
# A First Course in the Finite Element Method, 4th Edition
# Daryl L. Logan
# Example 2.1
# Units for this model are pounds and inches
system = FEModel3D()
system.add_node('1', 0, 0, 0)
system.add_node('2', 30, 0,... | round(-10000/11, 0) | assert | func_call | Testing/test_springs.py | test_spring_elements | 51 | null | |
JWock82/Pynite | import os
import pytest
import vtk
from io import BytesIO
from IPython.display import Image
from Pynite import FEModel3D
from Pynite import Visualization as VTKVis
from Pynite.Visualization import Renderer as VTKRenderer
from Pynite.Rendering import Renderer as PVRenderer
import pyvista as pv
pv.OFF_SCREEN = True
def... | 5.0 | assert | numeric_literal | Testing/test_Visualization.py | test_annotation_size_auto_single_node | 237 | null | |
JWock82/Pynite | import pytest
from Pynite import FEModel3D
def test_rectangle_mesh_regeneration():
"""Test that regenerating a RectangleMesh removes old nodes/elements."""
# Create a simple model
model = FEModel3D()
model.add_material('Steel', 29000, 11200, 0.3, 490)
# Add a rectangle mesh
mesh_name ... | initial_nodes | assert | variable | Testing/test_mesh_regeneration.py | test_rectangle_mesh_regeneration | 44 | null | |
JWock82/Pynite | import unittest
import numpy as np
from Pynite import FEModel3D
from Pynite.Material import Material
from Pynite.Section import Section, SteelSection
from Pynite.LoadCombo import LoadCombo
class TestSection(unittest.TestCase):
def setUp(self):
self.model = FEModel3D()
def test_section_gradient_calcul... | 0) | self.assertGreater | numeric_literal | Testing/test_material_section_coverage.py | test_section_gradient_calculation | TestSection | 124 | null |
JWock82/Pynite | import pytest
from Pynite import FEModel3D
def test_rectangle_mesh_regeneration():
"""Test that regenerating a RectangleMesh removes old nodes/elements."""
# Create a simple model
model = FEModel3D()
model.add_material('Steel', 29000, 11200, 0.3, 490)
# Add a rectangle mesh
mesh_name ... | initial_elements | assert | variable | Testing/test_mesh_regeneration.py | test_rectangle_mesh_regeneration | 46 | null | |
JWock82/Pynite | import sys
sys.path.insert(0, r'c:\Users\craig\Documents\Python\Pynite')
from Pynite import FEModel3D
def test_multiple_meshes_independent_regeneration():
"""Test that regenerating one mesh doesn't affect other meshes."""
print("\n=== Test 4: Independent Mesh Regeneration ===")
# Create a model
... | mesh2_node_count | assert | variable | Testing/test_mesh_regen_simple.py | test_multiple_meshes_independent_regeneration | 173 | null | |
JWock82/Pynite | import sys
sys.path.insert(0, r'c:\Users\craig\Documents\Python\Pynite')
from Pynite import FEModel3D
def test_delete_mesh_with_attached_members():
"""Test that member elements attached to mesh nodes are preserved."""
print("\n=== Test 3: Mesh Deletion with Attached Members ===")
# Create a mode... | model.members | assert | complex_expr | Testing/test_delete_mesh.py | test_delete_mesh_with_attached_members | 150 | null | |
JWock82/Pynite | import pytest
from Pynite import FEModel3D
def test_rectangle_mesh_regeneration():
"""Test that regenerating a RectangleMesh removes old nodes/elements."""
# Create a simple model
model = FEModel3D()
model.add_material('Steel', 29000, 11200, 0.3, 490)
# Add a rectangle mesh
mesh_name ... | initial_element_count | assert | variable | Testing/test_mesh_regeneration.py | test_rectangle_mesh_regeneration | 40 | null | |
JWock82/Pynite | import os
import pytest
import vtk
from io import BytesIO
from IPython.display import Image
from Pynite import FEModel3D
from Pynite import Visualization as VTKVis
from Pynite.Visualization import Renderer as VTKRenderer
from Pynite.Rendering import Renderer as PVRenderer
import pyvista as pv
pv.OFF_SCREEN = True
def... | 12.0 | assert | numeric_literal | Testing/test_Visualization.py | test_annotation_size_manual_override | 253 | null | |
JWock82/Pynite | from Pynite import FEModel3D
import math
def test_hydrostatic_plate():
# Create the model
plate_model = FEModel3D()
# Define geometry
t = 1 # ft
mesh_size = 1 # ft
a = 10 # ft
b = 15 # ft
# Define a material
E = 57000*math.sqrt(4500)*12**2 # psf
G = 0.4*E # psf
nu =... | 0.15 | assert | numeric_literal | Testing/test_plates&quads.py | test_hydrostatic_plate | 120 | null | |
JWock82/Pynite | import enum
import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO
class Test_AISC_Benchmark(unittest.TestCase):
def setUp(self):
# Suppress printed output temporarily
# sys.stdout = StringIO()
pass
def tearDown(self):
# Reset the... | 2) | self.assertAlmostEqual | numeric_literal | Testing/test_AISC_PDelta_benchmarks.py | test_AISC_benchmark_case1 | Test_AISC_Benchmark | 160 | null |
JWock82/Pynite | import pytest
from Pynite import FEModel3D
def test_rectangle_mesh_regeneration():
"""Test that regenerating a RectangleMesh removes old nodes/elements."""
# Create a simple model
model = FEModel3D()
model.add_material('Steel', 29000, 11200, 0.3, 490)
# Add a rectangle mesh
mesh_name ... | initial_node_count | assert | variable | Testing/test_mesh_regeneration.py | test_rectangle_mesh_regeneration | 38 | null | |
JWock82/Pynite | import unittest
from Pynite import FEModel3D, Section
import sys
from io import StringIO
class TestLoads(unittest.TestCase):
def setUp(self):
# Suppress printed output temporarily
sys.stdout = StringIO()
def tearDown(self):
# Reset the print function to normal
sys.stdout = sys... | 2) | self.assertAlmostEqual | numeric_literal | Testing/test_loads.py | test_axial_distributed_load | TestLoads | 111 | null |
JWock82/Pynite | from __future__ import annotations
import pytest
from Pynite.FEModel3D import FEModel3D
def test_cluster_merge_and_element_rewire():
model = FEModel3D()
# Tight cluster around origin; all should collapse to first added node
n1 = model.add_node("N1", 0.0, 0.0, 0.0)
n2 = model.add_node("N2", 0.0004, 0.... | {"N2", "N3", "N4"} | assert | collection | Testing/test_node_merge.py | test_cluster_merge_and_element_rewire | 76 | null | |
JWock82/Pynite | import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO
class Test_2D_Frame(unittest.TestCase):
def setUp(self):
# Suppress printed output temporarily
sys.stdout = StringIO()
def tearDown(self):
# Reset the print function to normal
sys.stdou... | 0.05) | self.assertLess | numeric_literal | Testing/test_2D_frames.py | test_Kassimali_3_35 | Test_2D_Frame | 288 | null |
JWock82/Pynite | from Pynite import FEModel3D
import numpy as np
def test_spring_elements():
# A First Course in the Finite Element Method, 4th Edition
# Daryl L. Logan
# Example 2.1
# Units for this model are pounds and inches
system = FEModel3D()
system.add_node('1', 0, 0, 0)
system.add_node('2', 30, 0,... | round(-45000/11, 0) | assert | func_call | Testing/test_springs.py | test_spring_elements | 54 | null | |
JWock82/Pynite | import unittest
from Pynite import FEModel3D
class TestNode3D(unittest.TestCase):
def setUp(self):
self.model = FEModel3D()
self.model.add_node('N1', 0, 0, 0)
self.node = self.model.nodes['N1']
def test_node_load_lists_initialized(self):
"""Test that node load lists are initia... | []) | self.assertEqual | collection | Testing/test_node_spring_coverage.py | test_node_load_lists_initialized | TestNode3D | 85 | null |
JWock82/Pynite | from __future__ import annotations
import pytest
from Pynite.FEModel3D import FEModel3D
def test_no_merge_unique_nodes():
model = FEModel3D()
model.add_node("N1", 0.0, 0.0, 0.0)
model.add_node("N2", 1.0, 0.0, 0.0)
removed = model.merge_duplicate_nodes(tolerance=1e-6)
assert removed == []
a... | 2 | assert | numeric_literal | Testing/test_node_merge.py | test_no_merge_unique_nodes | 29 | null | |
JWock82/Pynite | from Pynite import FEModel3D
import numpy as np
def test_nodal_springs():
model = FEModel3D()
model.add_node('N1', 0, 0, 0)
model.def_support_spring('N1', 'DX', 1000)
model.def_support_spring('N1', 'DY', 2000)
model.def_support_spring('N1', 'DZ', 3000)
model.def_support_spring('N1', 'RX', 40... | -1 | assert | numeric_literal | Testing/test_springs.py | test_nodal_springs | 78 | null | |
JWock82/Pynite | import os
import pytest
import vtk
from io import BytesIO
from IPython.display import Image
from Pynite import FEModel3D
from Pynite import Visualization as VTKVis
from Pynite.Visualization import Renderer as VTKRenderer
from Pynite.Rendering import Renderer as PVRenderer
import pyvista as pv
pv.OFF_SCREEN = True
def... | [] | assert | collection | Testing/test_Visualization.py | test_member_end_release_none | 363 | null | |
JWock82/Pynite | import os
import pytest
import vtk
from io import BytesIO
from IPython.display import Image
from Pynite import FEModel3D
from Pynite import Visualization as VTKVis
from Pynite.Visualization import Renderer as VTKRenderer
from Pynite.Rendering import Renderer as PVRenderer
import pyvista as pv
pv.OFF_SCREEN = True
def... | 25 | assert | numeric_literal | Testing/test_Visualization.py | test_toggle_deformed_shape | 184 | null | |
JWock82/Pynite | from Pynite import FEModel3D
from Pynite.Rendering import Renderer
from math import isclose
def test_PCA_7_quad():
"""
Tests against the example from Section 7 of "Circular Concrete Tanks
without Prestressing" by PCA.
"""
# Create a new finite element model
tank_model = FEModel3D()
H = 20... | 0 | assert | numeric_literal | Testing/test_meshes.py | test_PCA_7_quad | 129 | null | |
chiphuyen/sniffly | import json
import os
import sys
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, Mock, patch
import pytest
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
class TestRefreshAllProjects:
@pytest.mark.asyncio
async def test_refresh_all_projects_no_chan... | 3 | assert | numeric_literal | tests/sniffly/test_server.py | test_refresh_all_projects_no_changes | TestRefreshAllProjects | 420 | null |
chiphuyen/sniffly | import json
import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.constants import USER_INTERRUPTION_PATTERNS
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.core.s... | "Error rate should be >= 0") | self.assertGreaterEqual | string_literal | tests/sniffly/core/test_stats.py | test_error_statistics | TestStatisticsCalculations | 322 | null |
chiphuyen/sniffly | import json
import os
import sys
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, Mock, patch
import pytest
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
class TestRefreshAllProjects:
@pytest.mark.asyncio
async def test_refresh_all_projects_handles... | 2 | assert | numeric_literal | tests/sniffly/test_server.py | test_refresh_all_projects_handles_errors | TestRefreshAllProjects | 525 | null |
chiphuyen/sniffly | import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from sniffly.utils.log_finder import find_claude_logs, get_all_projects_with_metadata
class TestGetAllProjectsWithMetadata:
def test_projects_with_jsonl_files(self):
"""Test getting metadata for projects with JSONL fi... | 2 | assert | numeric_literal | tests/sniffly/utils/test_log_finder.py | test_projects_with_jsonl_files | TestGetAllProjectsWithMetadata | 56 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import time
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.utils.local_cache import LocalCacheService
from sniffly.utils.memory_cache impor... | "Should process each file in under 100ms") | self.assertLess | string_literal | tests/sniffly/test_performance.py | test_large_dataset_performance | TestProcessingPerformance | 131 | null |
chiphuyen/sniffly | import json
import os
import sys
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, Mock, patch
import pytest
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
class TestProjectsAPIEndpoint:
def test_projects_api_with_mock_data(self):
"""Test project... | 1 | assert | numeric_literal | tests/sniffly/test_server.py | test_projects_api_with_mock_data | TestProjectsAPIEndpoint | 370 | null |
chiphuyen/sniffly | import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
class TestActualDataVerification(unittest.TestCase):
def setUpClass(cls):
"""Set up test data dir... | "Should have data for 2025-06-08") | self.assertIn | string_literal | tests/sniffly/test_processor_data_verification.py | test_total_tokens_by_day | TestActualDataVerification | 94 | null |
chiphuyen/sniffly | import logging
from datetime import datetime, timedelta
from unittest.mock import Mock, patch
import pytest
from sniffly.core.global_aggregator import GlobalStatsAggregator
class TestGlobalStatsAggregator:
def mock_caches(self):
"""Create mock cache instances."""
memory_cache = Mock()
fi... | None | assert | none_literal | tests/sniffly/core/test_global_aggregator.py | test_daily_aggregation | TestGlobalStatsAggregator | 179 | null |
chiphuyen/sniffly | import pytest
from sniffly.utils.memory_cache import MemoryCache
class TestMemoryCache:
def test_basic_get_put(self):
"""Test basic cache operations."""
cache = MemoryCache(max_projects=3)
# Test miss
result = cache.get("/path/to/project1")
assert result is None
... | 0 | assert | numeric_literal | tests/sniffly/utils/test_memory_cache.py | test_basic_get_put | TestMemoryCache | 22 | null |
chiphuyen/sniffly | import json
import os
import tempfile
from datetime import datetime
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from sniffly.share import ShareManager
def temp_dir():
"""Create a temporary directory for testing."""
with tempfile.TemporaryDirectory() as tmpdir:... | result | assert | variable | tests/sniffly/test_share.py | test_create_share_link_basic | TestShareManager | 88 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import time
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.utils.local_cache import LocalCacheService
from sniffly.utils.memory_cache impor... | cached_stats) | self.assertIsNotNone | variable | tests/sniffly/test_performance.py | test_file_cache_performance | TestProcessingPerformance | 262 | null |
chiphuyen/sniffly | import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from sniffly.utils.log_finder import find_claude_logs, get_all_projects_with_metadata
class TestFindClaudeLogs:
def test_find_logs_without_jsonl(self):
"""Test that directories without JSONL files return None."""
... | None | assert | none_literal | tests/sniffly/utils/test_log_finder.py | test_find_logs_without_jsonl | TestFindClaudeLogs | 157 | null |
chiphuyen/sniffly | import logging
from datetime import datetime, timedelta
from unittest.mock import Mock, patch
import pytest
from sniffly.core.global_aggregator import GlobalStatsAggregator
class TestGlobalStatsAggregator:
def mock_caches(self):
"""Create mock cache instances."""
memory_cache = Mock()
fi... | 30 | assert | numeric_literal | tests/sniffly/core/test_global_aggregator.py | test_get_global_stats_basic | TestGlobalStatsAggregator | 135 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.processor import ClaudeLogProcessor, Interaction
class TestClaudeLogProcessor(unittest.TestCase):
def setUpClass(cls)... | msg) | self.assertIn | variable | tests/sniffly/core/test_processor.py | test_message_extraction | TestClaudeLogProcessor | 78 | null |
chiphuyen/sniffly | import json
import os
import sys
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, Mock, patch
import pytest
from fastapi import HTTPException
from fastapi.testclient import TestClient
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), '..', 'sniff... | True | assert | bool_literal | tests/sniffly-site/test_admin.py | test_feature_project | TestAdminAPIEndpoints | 348 | null |
chiphuyen/sniffly | import json
import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.constants import USER_INTERRUPTION_PATTERNS
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.core.s... | stats) | self.assertIn | variable | tests/sniffly/core/test_stats.py | test_empty_project | TestEdgeCases | 774 | null |
chiphuyen/sniffly | import json
import os
from pathlib import Path
from unittest.mock import patch
import pytest
from click.testing import CliRunner
from sniffly.cli import cli
from sniffly.config import Config
class TestConfig:
def test_parse_integer_values(self):
"""Test integer value parsing."""
cfg = Config()
... | 123 | assert | numeric_literal | tests/sniffly/test_cli.py | test_parse_integer_values | TestConfig | 209 | null |
chiphuyen/sniffly | import hashlib
import json
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
class TestProcessorOptimizationCorrectness(unittest.TestCase):
def setUpClass(cls):
"""Set up test data di... | "Token counts should be identical") | self.assertEqual | string_literal | tests/sniffly/test_processor_optimization_correctness.py | test_statistics_unchanged | TestProcessorOptimizationCorrectness | 103 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import time
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.utils.local_cache import LocalCacheService
from sniffly.utils.memory_cache impor... | "Warm processing shouldn't be significantly slower than cold") | self.assertLessEqual | string_literal | tests/sniffly/test_performance.py | test_incremental_processing_performance | TestProcessingPerformance | 160 | null |
chiphuyen/sniffly | import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
class TestActualDataVerification(unittest.TestCase):
def setUpClass(cls):
"""Set up test data dir... | "Should have error rate") | self.assertIn | string_literal | tests/sniffly/test_processor_data_verification.py | test_error_count | TestActualDataVerification | 233 | null |
chiphuyen/sniffly | import json
import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.constants import USER_INTERRUPTION_PATTERNS
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.core.s... | 3) | self.assertEqual | numeric_literal | tests/sniffly/core/test_stats.py | test_search_tool_percentage | TestStatisticsCalculations | 753 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.processor import ClaudeLogProcessor, Interaction
class TestClaudeLogProcessor(unittest.TestCase):
def setUpClass(cls)... | statistics) | self.assertIn | variable | tests/sniffly/core/test_processor.py | test_basic_processing | TestClaudeLogProcessor | 60 | null |
chiphuyen/sniffly | import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
class TestActualDataVerification(unittest.TestCase):
def setUpClass(cls):
"""Set up test data dir... | "Statistics should show 4 sessions") | self.assertEqual | string_literal | tests/sniffly/test_processor_data_verification.py | test_number_of_sessions | TestActualDataVerification | 33 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.processor import ClaudeLogProcessor, Interaction
class TestClaudeLogProcessor(unittest.TestCase):
def setUpClass(cls)... | 10) | self.assertEqual | numeric_literal | tests/sniffly/core/test_processor.py | test_streaming_message_merge | TestClaudeLogProcessor | 225 | null |
chiphuyen/sniffly | import json
import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.constants import USER_INTERRUPTION_PATTERNS
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.core.s... | "UTC should have 24 hours") | self.assertEqual | string_literal | tests/sniffly/core/test_stats.py | test_hourly_pattern_with_timezone | TestStatisticsCalculations | 601 | null |
chiphuyen/sniffly | import hashlib
import json
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
class TestProcessorOptimizationCorrectness(unittest.TestCase):
def setUpClass(cls):
"""Set up test data di... | "Message content should be identical") | self.assertEqual | string_literal | tests/sniffly/test_processor_optimization_correctness.py | test_message_content_unchanged | TestProcessorOptimizationCorrectness | 88 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.processor import ClaudeLogProcessor, Interaction
class TestClaudeLogProcessor(unittest.TestCase):
def setUpClass(cls)... | statistics['overview']) | self.assertIn | complex_expr | tests/sniffly/core/test_processor.py | test_basic_processing | TestClaudeLogProcessor | 61 | null |
chiphuyen/sniffly | import pytest
from sniffly.utils.memory_cache import MemoryCache
class TestMemoryCache:
def test_basic_get_put(self):
"""Test basic cache operations."""
cache = MemoryCache(max_projects=3)
# Test miss
result = cache.get("/path/to/project1")
assert result is | None | assert | none_literal | tests/sniffly/utils/test_memory_cache.py | test_basic_get_put | TestMemoryCache | 20 | null |
chiphuyen/sniffly | import json
import os
import tempfile
from datetime import datetime
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from sniffly.share import ShareManager
def temp_dir():
"""Create a temporary directory for testing."""
with tempfile.TemporaryDirectory() as tmpdir:... | 0 | assert | numeric_literal | tests/sniffly/test_share.py | test_create_share_link_basic | TestShareManager | 105 | null |
chiphuyen/sniffly | import json
import os
import sys
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, Mock, patch
import pytest
from fastapi import HTTPException
from fastapi.testclient import TestClient
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), '..', 'sniff... | 0 | assert | numeric_literal | tests/sniffly-site/test_admin.py | test_get_share_stats | TestAdminHelperFunctions | 113 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.processor import ClaudeLogProcessor, Interaction
class TestProcessorHelpers(unittest.TestCase):
def test_interaction_... | 'test-session') | self.assertEqual | string_literal | tests/sniffly/core/test_processor.py | test_interaction_class | TestProcessorHelpers | 295 | null |
chiphuyen/sniffly | import json
import os
import sys
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, Mock, patch
import pytest
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
class TestServerConfiguration:
def test_cache_configuration_from_env(self):
"""Test that c... | 5 | assert | numeric_literal | tests/sniffly/test_server.py | test_cache_configuration_from_env | TestServerConfiguration | 283 | null |
chiphuyen/sniffly | import json
import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.constants import USER_INTERRUPTION_PATTERNS
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.core.s... | "Should have 4 JSONL files") | self.assertEqual | string_literal | tests/sniffly/core/test_stats.py | test_session_count | TestStatisticsCalculations | 55 | null |
chiphuyen/sniffly | import json
import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.constants import USER_INTERRUPTION_PATTERNS
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.core.s... | result2) | self.assertEqual | variable | tests/sniffly/core/test_stats.py | test_search_tool_detection | TestStatisticsCalculations | 674 | null |
chiphuyen/sniffly | import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
class TestActualDataVerification(unittest.TestCase):
def setUpClass(cls):
"""Set up test data dir... | push_cmd) | self.assertIsNotNone | variable | tests/sniffly/test_processor_data_verification.py | test_interruption_patterns | TestActualDataVerification | 73 | null |
chiphuyen/sniffly | import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from sniffly.utils.log_finder import find_claude_logs, get_all_projects_with_metadata
class TestFindClaudeLogs:
def test_find_logs_with_leading_dash(self):
"""Test finding logs for a project path."""
with temp... | str(project_dir) | assert | func_call | tests/sniffly/utils/test_log_finder.py | test_find_logs_with_leading_dash | TestFindClaudeLogs | 143 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import time
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.utils.local_cache import LocalCacheService
from sniffly.utils.memory_cache impor... | par_results) | self.assertIsNotNone | variable | tests/sniffly/test_performance.py | test_parallel_processing_simulation | TestProcessingPerformance | 309 | null |
chiphuyen/sniffly | import json
import os
import sys
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, Mock, patch
import pytest
from fastapi import HTTPException
from fastapi.testclient import TestClient
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), '..', 'sniff... | 400 | assert | numeric_literal | tests/sniffly-site/test_admin.py | test_admin_callback_invalid_state | TestAdminAuthEndpoints | 242 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import time
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.utils.local_cache import LocalCacheService
from sniffly.utils.memory_cache impor... | "Should process at least 15 files/second for large datasets") | self.assertGreater | string_literal | tests/sniffly/test_performance.py | test_large_dataset_performance | TestProcessingPerformance | 129 | null |
chiphuyen/sniffly | import logging
from datetime import datetime, timedelta
from unittest.mock import Mock, patch
import pytest
from sniffly.core.global_aggregator import GlobalStatsAggregator
class TestGlobalStatsAggregator:
def mock_caches(self):
"""Create mock cache instances."""
memory_cache = Mock()
fi... | 1 | assert | numeric_literal | tests/sniffly/core/test_global_aggregator.py | test_process_uncached_projects | TestGlobalStatsAggregator | 209 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.processor import ClaudeLogProcessor, Interaction
class TestProcessorHelpers(unittest.TestCase):
def test_interaction_... | 1) | self.assertEqual | numeric_literal | tests/sniffly/core/test_processor.py | test_interaction_class | TestProcessorHelpers | 309 | null |
chiphuyen/sniffly | import json
import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from sniffly.core.constants import USER_INTERRUPTION_PATTERNS
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.core.s... | "Error rate should be <= 1") | self.assertLessEqual | string_literal | tests/sniffly/core/test_stats.py | test_error_statistics | TestStatisticsCalculations | 323 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import time
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.utils.local_cache import LocalCacheService
from sniffly.utils.memory_cache impor... | cache_success) | self.assertTrue | variable | tests/sniffly/test_performance.py | test_memory_cache_performance | TestProcessingPerformance | 225 | null |
chiphuyen/sniffly | import os
import sys
import unittest
from collections import defaultdict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
class TestActualDataVerification(unittest.TestCase):
def setUpClass(cls):
"""Set up test data dir... | model_dist) | self.assertIn | variable | tests/sniffly/test_processor_data_verification.py | test_model_usage | TestActualDataVerification | 119 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import time
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.utils.local_cache import LocalCacheService
from sniffly.utils.memory_cache impor... | "Total processing should complete within 2 seconds") | self.assertLess | string_literal | tests/sniffly/test_performance.py | test_full_processing_time | TestProcessingPerformance | 82 | null |
chiphuyen/sniffly | import json
import os
import shutil
import sys
import tempfile
import time
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sniffly.core.processor import ClaudeLogProcessor
from sniffly.utils.local_cache import LocalCacheService
from sniffly.utils.memory_cache impor... | "Should cache all messages") | self.assertEqual | string_literal | tests/sniffly/test_performance.py | test_file_cache_performance | TestProcessingPerformance | 264 | null |
chiphuyen/sniffly | import json
import os
import tempfile
from datetime import datetime
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from sniffly.share import ShareManager
def temp_dir():
"""Create a temporary directory for testing."""
with tempfile.TemporaryDirectory() as tmpdir:... | 5 | assert | numeric_literal | tests/sniffly/test_share.py | test_duration_calculation | TestShareManager | 244 | null |
chiphuyen/sniffly | import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from sniffly.utils.log_finder import find_claude_logs, get_all_projects_with_metadata
class TestGetAllProjectsWithMetadata:
def test_project_without_leading_dash(self):
"""Test project directory without leading dash."... | 'local-project' | assert | string_literal | tests/sniffly/utils/test_log_finder.py | test_project_without_leading_dash | TestGetAllProjectsWithMetadata | 91 | null |
chiphuyen/sniffly | import logging
from datetime import datetime, timedelta
from unittest.mock import Mock, patch
import pytest
from sniffly.core.global_aggregator import GlobalStatsAggregator
class TestGlobalStatsAggregator:
def mock_caches(self):
"""Create mock cache instances."""
memory_cache = Mock()
fi... | 6000 | assert | numeric_literal | tests/sniffly/core/test_global_aggregator.py | test_get_global_stats_basic | TestGlobalStatsAggregator | 127 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.