@@ -2087,44 +2087,49 @@ def test_scanpipe_codebase_resource_queryset_has_directory_content_fingerprint(
2087
2087
2088
2088
def test_scanpipe_codebase_resource_queryset_elfs (self ):
2089
2089
project = Project .objects .create (name = "Test" )
2090
- resource_starting_with_elf_and_executable_in_file_type = CodebaseResource . objects . create (
2090
+ resource_starting_with_elf_and_executable_in_file_type = CodebaseResource (
2091
2091
file_type = """ELF 32-bit LSB executable, ARM, version 1 (ARM), statically
2092
2092
linked, with debug_info, not stripped""" ,
2093
2093
project = project ,
2094
2094
path = "a" ,
2095
2095
type = CodebaseResource .Type .FILE ,
2096
2096
)
2097
- resource_with_executable_in_file_type = CodebaseResource .objects .create (
2097
+ resource_starting_with_elf_and_executable_in_file_type .save ()
2098
+ resource_with_executable_in_file_type = CodebaseResource (
2098
2099
file_type = """32-bit LSB executable, ARM, version 1 (ARM), statically
2099
2100
linked, with debug_info, not stripped""" ,
2100
2101
project = project ,
2101
2102
path = "b" ,
2102
2103
type = CodebaseResource .Type .FILE ,
2103
2104
)
2104
- resource_starting_with_elf_in_file_type = CodebaseResource .objects .create (
2105
+ resource_with_executable_in_file_type .save ()
2106
+ resource_starting_with_elf_in_file_type = CodebaseResource (
2105
2107
file_type = """ELF 32-bit LSB resourcable, ARM, version 1 (ARM), statically
2106
2108
linked, with debug_info, not stripped""" ,
2107
2109
project = project ,
2108
2110
path = "c" ,
2109
2111
type = CodebaseResource .Type .FILE ,
2110
2112
)
2111
- resource = CodebaseResource .objects .create (
2113
+ resource_starting_with_elf_in_file_type .save ()
2114
+ resource = CodebaseResource (
2112
2115
file_type = """32-bit LSB relocatable, ARM, version 1 (ARM), statically
2113
2116
linked, with debug_info, not stripped""" ,
2114
2117
project = project ,
2115
2118
path = "d" ,
2116
2119
type = CodebaseResource .Type .FILE ,
2117
2120
)
2118
- resource_starting_with_elf_and_relocatable_in_file_type = CodebaseResource .objects .create (
2121
+ resource .save ()
2122
+ resource_starting_with_elf_and_relocatable_in_file_type = CodebaseResource (
2119
2123
file_type = """ELF 32-bit LSB relocatable, ARM, version 1 (ARM), statically
2120
2124
linked, with debug_info, not stripped""" ,
2121
2125
project = project ,
2122
2126
path = "e" ,
2123
2127
type = CodebaseResource .Type .FILE ,
2124
2128
)
2129
+ resource_starting_with_elf_and_relocatable_in_file_type .save ()
2125
2130
paths = [str (resource .path ) for resource in project .codebaseresources .elfs ()]
2126
- assert "e" in paths
2127
- assert "a" in paths
2131
+ self . assertTrue ( "e" in paths )
2132
+ self . assertTrue ( "a" in paths )
2128
2133
2129
2134
2130
2135
class ScanPipeModelsTransactionTest (TransactionTestCase ):
0 commit comments