11use binaryninja:: binary_view:: BinaryViewExt ;
2- use binaryninja:: collaboration:: { NoNameChangeset , Remote , RemoteFileType , RemoteProject } ;
2+ use binaryninja:: collaboration:: { has_collaboration_support , NoNameChangeset , Remote , RemoteFileType , RemoteProject } ;
33use binaryninja:: headless:: Session ;
44use binaryninja:: symbol:: { SymbolBuilder , SymbolType } ;
55use rstest:: * ;
@@ -47,11 +47,11 @@ fn temp_project_scope<T: Fn(&RemoteProject)>(remote: &Remote, cb: T) {
4747
4848#[ rstest]
4949fn test_connection ( _session : & Session ) {
50- let remotes = binaryninja:: collaboration:: known_remotes ( ) ;
51- if remotes. is_empty ( ) {
52- eprintln ! ( "No known remotes, skipping test..." ) ;
50+ if !has_collaboration_support ( ) {
51+ eprintln ! ( "No collaboration support, skipping test..." ) ;
5352 return ;
5453 }
54+ let remotes = binaryninja:: collaboration:: known_remotes ( ) ;
5555 let remote = remotes. iter ( ) . next ( ) . expect ( "No known remotes!" ) ;
5656 assert ! ( remote. connect( ) . is_ok( ) , "Failed to connect to remote" ) ;
5757 remote
@@ -62,11 +62,11 @@ fn test_connection(_session: &Session) {
6262
6363#[ rstest]
6464fn test_project_creation ( _session : & Session ) {
65- let remotes = binaryninja:: collaboration:: known_remotes ( ) ;
66- if remotes. is_empty ( ) {
67- eprintln ! ( "No known remotes, skipping test..." ) ;
65+ if !has_collaboration_support ( ) {
66+ eprintln ! ( "No collaboration support, skipping test..." ) ;
6867 return ;
6968 }
69+ let remotes = binaryninja:: collaboration:: known_remotes ( ) ;
7070 let remote = remotes. iter ( ) . next ( ) . expect ( "No known remotes!" ) ;
7171 temp_project_scope ( & remote, |project| {
7272 // Create the file than verify it by opening and checking contents.
@@ -142,11 +142,11 @@ fn test_project_creation(_session: &Session) {
142142
143143#[ rstest]
144144fn test_project_sync ( _session : & Session ) {
145- let remotes = binaryninja:: collaboration:: known_remotes ( ) ;
146- if remotes. is_empty ( ) {
147- eprintln ! ( "No known remotes, skipping test..." ) ;
145+ if !has_collaboration_support ( ) {
146+ eprintln ! ( "No collaboration support, skipping test..." ) ;
148147 return ;
149148 }
149+ let remotes = binaryninja:: collaboration:: known_remotes ( ) ;
150150 let remote = remotes. iter ( ) . next ( ) . expect ( "No known remotes!" ) ;
151151 temp_project_scope ( & remote, |project| {
152152 // Open a view so that we can upload it.
0 commit comments