Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -9,11 +9,13 @@ using StellaOps.Scanner.CallGraph.Python;
|
||||
using StellaOps.Scanner.Reachability;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Scanner.CallGraph.Tests;
|
||||
|
||||
public class PythonCallGraphExtractorTests
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void PythonEntrypointClassifier_ClassifiesFlaskRoute()
|
||||
{
|
||||
// Arrange
|
||||
@@ -40,7 +42,8 @@ public class PythonCallGraphExtractorTests
|
||||
Assert.Equal(EntrypointType.HttpHandler, result.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void PythonEntrypointClassifier_ClassifiesFastApiRoute()
|
||||
{
|
||||
// Arrange
|
||||
@@ -67,7 +70,8 @@ public class PythonCallGraphExtractorTests
|
||||
Assert.Equal(EntrypointType.HttpHandler, result.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void PythonEntrypointClassifier_ClassifiesCeleryTask()
|
||||
{
|
||||
// Arrange
|
||||
@@ -94,7 +98,8 @@ public class PythonCallGraphExtractorTests
|
||||
Assert.Equal(EntrypointType.BackgroundJob, result.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void PythonEntrypointClassifier_ClassifiesClickCommand()
|
||||
{
|
||||
// Arrange
|
||||
@@ -121,7 +126,8 @@ public class PythonCallGraphExtractorTests
|
||||
Assert.Equal(EntrypointType.CliCommand, result.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void PythonSinkMatcher_MatchesSubprocessCall()
|
||||
{
|
||||
// Arrange
|
||||
@@ -134,7 +140,8 @@ public class PythonCallGraphExtractorTests
|
||||
Assert.Equal(SinkCategory.CmdExec, result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void PythonSinkMatcher_MatchesEval()
|
||||
{
|
||||
// Arrange
|
||||
@@ -147,7 +154,8 @@ public class PythonCallGraphExtractorTests
|
||||
Assert.Equal(SinkCategory.CodeInjection, result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void PythonSinkMatcher_MatchesPickleLoads()
|
||||
{
|
||||
// Arrange
|
||||
@@ -160,7 +168,8 @@ public class PythonCallGraphExtractorTests
|
||||
Assert.Equal(SinkCategory.UnsafeDeser, result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void PythonSinkMatcher_MatchesSqlAlchemyExecute()
|
||||
{
|
||||
// Arrange
|
||||
@@ -173,7 +182,8 @@ public class PythonCallGraphExtractorTests
|
||||
Assert.Equal(SinkCategory.SqlRaw, result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void PythonSinkMatcher_ReturnsNullForSafeFunction()
|
||||
{
|
||||
// Arrange
|
||||
|
||||
Reference in New Issue
Block a user