@@ -2112,44 +2112,49 @@ def test_scanpipe_codebase_resource_queryset_has_directory_content_fingerprint(
2112
2112
2113
2113
def test_scanpipe_codebase_resource_queryset_elfs (self ):
2114
2114
project = Project .objects .create (name = "Test" )
2115
- resource_starting_with_elf_and_executable_in_file_type = CodebaseResource . objects . create (
2115
+ resource_starting_with_elf_and_executable_in_file_type = CodebaseResource (
2116
2116
file_type = """ELF 32-bit LSB executable, ARM, version 1 (ARM), statically
2117
2117
linked, with debug_info, not stripped""" ,
2118
2118
project = project ,
2119
2119
path = "a" ,
2120
2120
type = CodebaseResource .Type .FILE ,
2121
2121
)
2122
- resource_with_executable_in_file_type = CodebaseResource .objects .create (
2122
+ resource_starting_with_elf_and_executable_in_file_type .save ()
2123
+ resource_with_executable_in_file_type = CodebaseResource (
2123
2124
file_type = """32-bit LSB executable, ARM, version 1 (ARM), statically
2124
2125
linked, with debug_info, not stripped""" ,
2125
2126
project = project ,
2126
2127
path = "b" ,
2127
2128
type = CodebaseResource .Type .FILE ,
2128
2129
)
2129
- resource_starting_with_elf_in_file_type = CodebaseResource .objects .create (
2130
+ resource_with_executable_in_file_type .save ()
2131
+ resource_starting_with_elf_in_file_type = CodebaseResource (
2130
2132
file_type = """ELF 32-bit LSB resourcable, ARM, version 1 (ARM), statically
2131
2133
linked, with debug_info, not stripped""" ,
2132
2134
project = project ,
2133
2135
path = "c" ,
2134
2136
type = CodebaseResource .Type .FILE ,
2135
2137
)
2136
- resource = CodebaseResource .objects .create (
2138
+ resource_starting_with_elf_in_file_type .save ()
2139
+ resource = CodebaseResource (
2137
2140
file_type = """32-bit LSB relocatable, ARM, version 1 (ARM), statically
2138
2141
linked, with debug_info, not stripped""" ,
2139
2142
project = project ,
2140
2143
path = "d" ,
2141
2144
type = CodebaseResource .Type .FILE ,
2142
2145
)
2143
- resource_starting_with_elf_and_relocatable_in_file_type = CodebaseResource .objects .create (
2146
+ resource .save ()
2147
+ resource_starting_with_elf_and_relocatable_in_file_type = CodebaseResource (
2144
2148
file_type = """ELF 32-bit LSB relocatable, ARM, version 1 (ARM), statically
2145
2149
linked, with debug_info, not stripped""" ,
2146
2150
project = project ,
2147
2151
path = "e" ,
2148
2152
type = CodebaseResource .Type .FILE ,
2149
2153
)
2154
+ resource_starting_with_elf_and_relocatable_in_file_type .save ()
2150
2155
paths = [str (resource .path ) for resource in project .codebaseresources .elfs ()]
2151
- assert "e" in paths
2152
- assert "a" in paths
2156
+ self . assertTrue ( "e" in paths )
2157
+ self . assertTrue ( "a" in paths )
2153
2158
2154
2159
2155
2160
class ScanPipeModelsTransactionTest (TransactionTestCase ):
0 commit comments