mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-08 05:50:47 +00:00
Consistently rename response fields to CamelCase. #116
This commit is contained in:
+5
-5
@@ -302,9 +302,9 @@ func apiReposPackageFromDir(c *gin.Context) {
|
||||
packageFiles, failedFiles []string
|
||||
processedFiles, failedFiles2 []string
|
||||
reporter = &aptly.RecordingResultReporter{
|
||||
Warnings: []string{},
|
||||
Adds: []string{},
|
||||
Removes: []string{},
|
||||
Warnings: []string{},
|
||||
AddedLines: []string{},
|
||||
RemovedLines: []string{},
|
||||
}
|
||||
list *deb.PackageList
|
||||
)
|
||||
@@ -364,7 +364,7 @@ func apiReposPackageFromDir(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(200, gin.H{
|
||||
"report": reporter,
|
||||
"failedFiles": failedFiles,
|
||||
"Report": reporter,
|
||||
"FailedFiles": failedFiles,
|
||||
})
|
||||
}
|
||||
|
||||
+5
-5
@@ -41,9 +41,9 @@ func (c *ConsoleResultReporter) Added(msg string, a ...interface{}) {
|
||||
|
||||
// RecordingResultReporter is implementation of ResultReporter that collects all messages
|
||||
type RecordingResultReporter struct {
|
||||
Warnings []string `json:"warnings"`
|
||||
Adds []string `json:"added"`
|
||||
Removes []string `json:"removed"`
|
||||
Warnings []string
|
||||
AddedLines []string `json:"Added"`
|
||||
RemovedLines []string `json:"Removed"`
|
||||
}
|
||||
|
||||
// Check interface
|
||||
@@ -58,10 +58,10 @@ func (r *RecordingResultReporter) Warning(msg string, a ...interface{}) {
|
||||
|
||||
// Removed is signal that something has been removed
|
||||
func (r *RecordingResultReporter) Removed(msg string, a ...interface{}) {
|
||||
r.Removes = append(r.Removes, fmt.Sprintf(msg, a...))
|
||||
r.RemovedLines = append(r.RemovedLines, fmt.Sprintf(msg, a...))
|
||||
}
|
||||
|
||||
// Added is signal that something has been added
|
||||
func (r *RecordingResultReporter) Added(msg string, a ...interface{}) {
|
||||
r.Adds = append(r.Adds, fmt.Sprintf(msg, a...))
|
||||
r.AddedLines = append(r.AddedLines, fmt.Sprintf(msg, a...))
|
||||
}
|
||||
|
||||
+10
-10
@@ -63,11 +63,11 @@ class ReposAPITestAdd(APITest):
|
||||
resp = self.post("/api/repos/" + repo_name + "/file/" + d)
|
||||
self.check_equal(resp.status_code, 200)
|
||||
self.check_equal(resp.json(), {
|
||||
u'failedFiles': [],
|
||||
u'report': {
|
||||
u'added': [u'pyspi_0.6.1-1.3_source added'],
|
||||
u'removed': [],
|
||||
u'warnings': []}})
|
||||
u'FailedFiles': [],
|
||||
u'Report': {
|
||||
u'Added': [u'pyspi_0.6.1-1.3_source added'],
|
||||
u'Removed': [],
|
||||
u'Warnings': []}})
|
||||
|
||||
self.check_equal(self.get("/api/repos/" + repo_name + "/packages").json(), ['Psource pyspi 0.6.1-1.3 3a8b37cbd9a3559e'])
|
||||
|
||||
@@ -129,11 +129,11 @@ class ReposAPITestAddFile(APITest):
|
||||
resp = self.post("/api/repos/" + repo_name + "/file/" + d + "/libboost-program-options-dev_1.49.0.1_i386.deb")
|
||||
self.check_equal(resp.status_code, 200)
|
||||
self.check_equal(resp.json(), {
|
||||
u'failedFiles': [],
|
||||
u'report': {
|
||||
u'added': [u'libboost-program-options-dev_1.49.0.1_i386 added'],
|
||||
u'removed': [],
|
||||
u'warnings': []}})
|
||||
u'FailedFiles': [],
|
||||
u'Report': {
|
||||
u'Added': [u'libboost-program-options-dev_1.49.0.1_i386 added'],
|
||||
u'Removed': [],
|
||||
u'Warnings': []}})
|
||||
|
||||
self.check_equal(self.get("/api/repos/" + repo_name + "/packages").json(),
|
||||
['Pi386 libboost-program-options-dev 1.49.0.1 918d2f433384e378'])
|
||||
|
||||
Reference in New Issue
Block a user